- Home /
Using Percentage to Move Object
Ok, when I create my button "Single Player" I can position it. That's all fine and dandy, but, is there a way t hat I can use %'s? So that it doesn't matter if the screen is resized, for instance:
if (GUI.Button(Rect(50,50,200,50),"Single Player"))
I would rather it was in percentage. Or, is there another way to combat positioning?
Answer by whydoidoit · Jan 20, 2013 at 03:45 PM
Well you can adjust the GUI.matrix to scale for different screen resolutions see this thread for more details.
You can just position things using things like
if(GUI.Button(Rect(0.1 * Screen.width, 0.1 * Screen.height, 0.4 * Screen.width, 0.1 * Screen.height)))
Your answer
![](https://koobas.hobune.stream/wayback/20220613091246im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Positioning elements with multiple resolutions 1 Answer
Relative positioning of speech bubble 1 Answer
GUI Cross Hair Positioning 1 Answer
Planning GUI position for iOS 1 Answer
Android tablet 10.1 and guiTexture gui placement with unity 0 Answers