- Home /
(C#) How to scale buttons and GUI Text to screen
How can you do that? I want to have a game where everything is the same relative size no matter the screen size. This would be for both computer and mobile. I already have the rectangle relative to the screen size but it's font isn't. So how do I make button fonts and GUI Texts relative to the screen size?
Do I have to do something like font size is equal to (fraction) of the screen size or is there a better way for GUI texts? And for buttons?
Here's the project: http://swissandor.github.io/2048/ It's a recreation of 2048.
Answer by NutellaDaddy · May 23, 2014 at 05:28 AM
You could use Screen.width and divide it by whatever to get your correct size and it will take the devices screen width or screen height(Screen.height) and than make it that size. That will make the same relative size for all!
Your answer
Follow this Question
Related Questions
Screen Sizes - HUD - Button Layout - Camera. 0 Answers
how to have an object positioned relative to the screen(like a button) 1 Answer
How to make game recognise Screen resolution on startup 1 Answer
Is Screen.Heigth a good way to id the iPhone generation? 1 Answer
GUI button in middle of screen 2 Answers