Hallo everyone,
Im currently working on a project where player can add their own text into the game. Im using GUI.labels to store the text. But if i write a pretty long word the word eventually goes offscreen. Is there a way to force the text to stay in the Label boundaries and automatically rescale itself to a smaller size when he reached the boundary? The project is for the iPhone. I know font scaling is prohibited on iPhone so maybe there is a workaround like a scrollbar or something?
Here is my code:
function OnGUI() {
GUI.matrix = Matrix4x4.TRS(new Vector3(GUIsF.x,GUIsF.y,0),Quaternion.identity,GUIsF);
GUI.Label(Rect(20,20,parchment.width/2,parchment.height/2),tempWord,mySkin_Good);
GUI.matrix = Matrix4x4.TRS(new Vector3(Screen.width - 258*GUIsF.x,GUIsF.y,0),Quaternion.identity,GUIsF);
GUI.Label(Rect(-20,20,parchment.width/2,parchment.height/2),currentWord,mySkin_Bad);
}
the tempWord & currentWord are the string which are being handled in another function. The matrix handles rescaling on different resolutions.
Thanks in advance.