Having trouble understanding HUD scaling

I’m having trouble understanding how to do this.

I have a HUD that comprises 3 GUITextures placed at the bottom of the screen.

I noticed afterwards that if I resize my screen, the textures aren’t fixed and will not scale and stay in their original positions to match the screen.

Is there a way to make it so the textures always fill the screen according to an original placement? And if you’re in free-scale mode, they scale with the resolution no matter what?

UnityGUI sizes are in pixel coordinates, so that’s why it doesn’t scale.

If you want to scale you have 2 options:

  1. Use scaling (GUIUtility.ScaleAroundPivot or similar)
  2. Detect screen resize and recalculate GUI element sizes according to the screen size (better, because you are in pixel domain and you can avoid bluriness)