How to lock gui buttons in a fixed position

I positioned 2 buttons in 16x9 aspect ratio, but when switching to free aspect the buttons were not aligned correctly with the background picture. How do i align them no matter the aspect ratio?

if you do buttons and background image all in OnGUI with GUI.Button and GUI.DrawImage it should be all fine

if you use GUITextures for all it should work too

if you use mixes, then you must implement a relative placement basing on the screen size within the OnGUI side as guitexture and guitext don’t work with pixels etc at all, they are placed in percent of the screensize

Can GUI textures be interactive buttons? I thought they were just used for DISPLAYS like heath, ammo, etc…

What if you use center of the screen as a starting point of button position calculations. BG texture is always same sized and, depending on Display aspect ratio, unnessary parts of BG texture are just cropped off. buttons are aligned starting from center location, so alignments are always at correct position. ( And ofcrouse use texture sizes in calculations instead of screen size ).

You can do whatever you like with them; that’s what OnMouseOver() etc. are for.

–Eric