- Home /
Fix Resizing For GUI Label?
So how many times have I asked questions this week? 100? Yeah sorry guys I'm close to finishing my game so I'm rushing it a little(please understand it's my first game ever). So yeah I need to know how to have automatic resizing for my GUI Labels. I know how to do it with buttons, but not labels. Here's how my Label looks like: GUI.Label (new Rect(10, 10, 200, 30), "Score: " + (int)(playerScore * 5));
It's pretty much the score label. I've had this for a while and I know there are different screen sizes for everything, so being able to fit is important. So how can I change that code to resize?
Completely unrelated, but when do I get to choose how to play the game on an Ipod/Ipad screen? By that I mean there are some games that make you play sideways/wide, and then there are those that make you play tall. So when do I get to set that?(You don't have to answer this little question, I'll probably figure out soon anyways).
Answer by Ekta-Mehta-D · Aug 14, 2014 at 06:03 AM
hello..
I think you should give rect height and width related to screen resolution.
So,
GUI.Label (new Rect(Screen.width * 0.2f , Screen.height * 0.2f , Screen.width * 0.4f , Screen.height * 0.25f), "Score: " + (int)(playerScore * 5));
You can change value as per your requirement size.
Thanks. Hope it helps..
Your answer
Follow this Question
Related Questions
GUI in the middle of the screen 1 Answer
How do I take maximum screenspace for Gui 1 Answer
How Do I Center A GUI Label? 5 Answers
how to get Gui in OnGUI function to resize with the window? 1 Answer
Scaling GUI Label not working? 1 Answer