1. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  2. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  3. We’re giving 2017.1 beta testers a chance to win t-shirts and a Nintendo Switch. Read more on the blog.
    Dismiss Notice
  4. We want to know how you learned Unity! Help us by taking this quick survey and have a chance at a $25 gift card
    Dismiss Notice
  5. Are you an artist or level designer going to Unite Europe? Join our roundtables there to discuss artist features.
    Dismiss Notice
  6. Unity 5.6 is now released.
    Dismiss Notice
  7. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice

Is the document of Rect so confuse ?

Discussion in 'Documentation' started by kactus223, Jun 19, 2017 at 5:10 AM.

  1. kactus223

    kactus223

    Joined:
    May 20, 2014
    Posts:
    18
    I've learnt and work with Unity for over 3 years, and have done some small games. But recently I have found out that all I known about unity's Rect is wrong. I read the document of Rect several times, and all I notice is the figure show me Rect's 4 most important params: x, y, width, height. As you can see on the figure, (x,y) is the top-left point of the rect. So everytime I create a new Rect, I always parse top left point's coordiate as x and y parameters. But I was wrong, (x,y) is actually bottom-left. It's just so embarassing that I don't know that until now. Is there anyone else got confuse like me, or is the document of Rect so confuse ?

    [​IMG]
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    31,133
    It's both top-left and bottom-left. The docs say that straight out; read the second paragraph again. It's arbitrary and depends on the context...there's nothing inherent that makes it one or the other. It could even be top-right or bottom-right, if you wanted it to be.

    --Eric