- Home /
Unity4.6 gui working with sprites on different resolutions
Hello Everyone,
in the last weeks i worked alot with the new Beta of Unity 4.6. For a Game i am making i want to use a menu which is not directly a menu. i want to use a background which acts like a map. on this map i want to place sprites who are acting like buttons.(so basicly they are buttons, as a buttons is as far as i saw just a sprites with the button script as a component)
this is working fine when i am using it in a special resolution. but now i am asking myself, how i can controll this design on different resolutions? is there a way like the anchor system of the new gui to tell the buttons where they have to be in relation to the ratio? or do i have to check on each resolution i want to support, where the button has to be placed, and have to do it over a script?
generally i could do it over a script and check the resolution, and place the buttons correctly, but i would like to know if there is another way.
because i already had many spots where i first solved my work trought sourcecode, and then i mentioned i can reach my target easier (for example, my first animations where codebased calculations :D then i understood the animation tool and the animator ^^)
i hope someone have a good tip for me :)
Greetings Gardosen
Answer by Ryujose · Oct 20, 2014 at 09:40 PM
I always do this with rect transform, editing on my own, you've tried to put anchors just in the corners of your sprite? This Works for me on rectangular buttons or images.
Go to Rect transform -> anchor presets and set the anchor preset that is bottom right and configure it like I said.
Hope it Works for you, I'm working now with circle sprites and it doesn't work the same so I'm still investigating, maybe I've to set it more accurate.
Regards!