Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     UILabel *testLabel = [[UILabel alloc] init];        
  2.     [testLabel setText:@"$1,500"];    
  3.     testLabel.textColor = [UIColor greenColor];
  4.     testLabel.backgroundColor = [UIColor clearColor];
  5.     testLabel.font = [UIFont fontWithName:@"Arial" size:24.0];     
  6.     CGSize finalSize = [testLabel sizeThatFits:CGSizeMake(480, 320)];
  7.     // I have to multiply by 2 because of retina.  No idea why I would need to multiply by 3.
  8.     [testLabel setFrame:CGRectMake(0, 0, finalSize.width * 2.0, finalSize.height * 2.0)];
  9.  
  10. /// Then, take this testLabel and dump it to bytes, render to OpenGL texture, and draw orthographic (2d) pixel-accurate drawing of it with the dimensions of (frame width by frame height)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement