Advertisement
Guest User

Untitled

a guest
Jul 30th, 2014
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. var textDimensions = GUI.skin.label.CalcSize(new GUIContent("text"));
  2. //textDimensions.x contains the width in pixels.
  3.  
  4. var textDimensions = GUI.skin.label.CalcSize(new GUIContent(thestring));
  5.  
  6. while (textDimensions.x > somesize) {
  7. cut off one character
  8. textDimensions = GUI.skin.label.CalcSize(new GUIContent(truncated string));
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement