Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var textDimensions = GUI.skin.label.CalcSize(new GUIContent("text"));
- //textDimensions.x contains the width in pixels.
- var textDimensions = GUI.skin.label.CalcSize(new GUIContent(thestring));
- while (textDimensions.x > somesize) {
- cut off one character
- textDimensions = GUI.skin.label.CalcSize(new GUIContent(truncated string));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement