Search Unity

  1. We've closed the job boards. If you're looking for work, or looking to hire check out Unity Connect. You can see more information here.
    Dismiss Notice
  2. We're running great holiday deals on subscriptions, swag and Asset Store packages! Take a peek at this blog for more information!
    Dismiss Notice
  3. Check out our Unite Austin 2017 YouTube playlist to catch up on what you missed. More videos coming soon.
    Dismiss Notice
  4. Unity 2017.2 is now released.
    Dismiss Notice
  5. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  6. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  8. Unity 2017.3 beta is now available for download.
    Dismiss Notice

Is the document of Rect so confuse ?

Discussion in 'Documentation' started by kactus223, Jun 19, 2017.

  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,400
    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