Keeping a GUI texture from moving during change of screen size

While setting up my own party creation scene in unity I noticed that some of my GUIs would move out of place if I changed to aspect ratio of the screen. How do I keep this from happening, I know it has to do with Screen.width, and Height, but even if I use those, and try to altr postions from them, it still does not work… thanks in advance :slight_smile: everyone that has helped me this far is awesom!!

http://unity3d.com/support/documentation/Components/class-GuiTexture.html

Pixel Inset

The purpose of the Pixel Inset is to prevent textures from scaling with screen resolution, and keeping thim in a fixed pixel size. This allows you to render a texture without any scaling. This means that players who run your game in higher resolutions will see your textures in smaller areas of the screen, allowing them to have more screen real-estate for your gameplay graphics.

To use it effectively, you need to set the scale of the GUI Texture’s Transform to (0, 0, 0). Now, the Pixel Inset is in full control of the texture’s size and you can set the Pixel Inset values to be the exact pixel size of your Texture.

This happens to me all the time… I’m not sure that there is much you can do about it, all I do is make the editor screen as big as possible, and then put my GUI elements in when the screen is at the size that it would be if the game was built.

Also, feel free to build your game and see where it is in relation to where you put it in the editor…

Hope this helps

-Grady