- Home /
Cropped Label Problem - Big Font - Unity3D
i get this problem:
The text in the label is cropped.
This is my code:
public var MenuSkin:GUISkin;
function OnGUI () {
GUI.skin = MenuSkin;
GUI.skin.font = myfont;
GUI.Label ( new Rect (Screen.width-310,Screen.height/2,300,50), "Number is 16");
}
The label is cropped. How do i fix it without changing the font because i need bigger font. Thank you ...
Comment
In screenshot you are using new UI 4.6 where as your script is for old immediate mode GUI (OnGUI)...?
Answer by Noah Dyer · Feb 04, 2015 at 08:25 PM
Your rect is based on screen size, which will change for different people, and will sometimes cause clipping. Either set it to a fixed size, or make it big enough that it will fit in any screen size.