Which way does a Rect expand?

For a Rect, the position you give is for the upper-left of the rectangle correct? Based on this, does the width/height which you provide cause an expansion of the rectangle to the upper-right or bottom-right?

The anchor of a Rect is the upper left corner, the first two coordinates in its constructor. Because the origin of the GUI coordinate system is at the upper left corner of your screen, the Rect expands toward the bottom right as a function of the width/height you provide.

It completely depends on the context you use the Rect. The Rect itself has a start point (x,y), width and height. Those are just 4 numbers.

  • In UnityGUI functions (0,0) is the upper-left corner and the positive width and height expand to the bottom right.
  • In device(viewport) coordinates, as used by Camera.rect, Camera.ViewportPointToRay, …, (0,0) is the bottom-left and (1,1) the upper-right corner.