Hello. I developed my game's GUI using absolute positions. At the 3:2 aspect ratio, everything looks fine. But, because I used absolute positions, any other resolution does not work properly with the GUI. Rather than go back and replace all of the GUI elements with relative positions manually, I was told Unity is able to do it automacily using this code. But I dont understand exactly what the person who posted the code meant, can someone please elaborate on it(here is the code and the persons explanation)?
asked Feb 25 '11 at 07:14 AM
He divides the "design" width and height with the current width and height of the screen window and feeds the scaling part of the standard 4x4 transformation matrix for the GUI.
So when your GUI was designed at a resolution of 1920x1200 (origWidth x origHeight) and the user resizes the window to a smaller size, the GUI will be scaled accordingly.
answered Feb 25 '11 at 12:42 PM