- Home /
Screen Space is non standard in Unity?
I find it strange that there seems to be no convention for Screen coordinates in Unity.
What I mean is that the Camera Screen space is defined as:
"A screen space point is defined in pixels. The bottom-left of the screen is (0,0); the right-top is (pixelWidth,pixelHeight). The z position is in world units from the camera."
But the Rect screen space is defined as:
"The coordinate system is top-left based. Rect(10, 20, 300, 100) defines a Rectangle that starts at coordinates: 0,20 and ends at coordinates 310,120. It is worth repeating that the second pair of values in Rect() are total width and height, not the coordinates where the controls end. This is why the example mentioned above ends at 310,120 and not 300,100."
As you can see, Camera is bottom-left based, while Rect is top-left based. This is very confusing. Am I missing something or is it just non standard like that?
Answer by Eric5h5 · Jul 21, 2010 at 10:31 PM
That's not correct; the Rect height just adds 100 to the Y coordinate. Whether it's bottom-up (screen space) or top-down (GUI space) is irrelevant.