Author Topic: Calculate NGUI widget position to screen position  (Read 5439 times)

terencekwan

  • Guest
Calculate NGUI widget position to screen position
« on: October 02, 2012, 08:00:52 PM »
I have a the following layout:

* Panel - UIAnchor TopRight
** Panel offset position x -500, y -50
*** Icon x 300, y 0

So, I can layout the button on the top right corner. ( http://screencast.com/t/ZrjePI5b9 ) .. So far so good and thank to the UIAnchor class.

However, I need to find out the world position class and localPosition returns me 300,0,0.  Is there a way to find out the world coordinate?

Thanks

deathmtn

  • Guest
Re: Calculate NGUI widget position to screen position
« Reply #1 on: October 02, 2012, 09:17:27 PM »
I think you may be able to just use something like icon.gameObject.transform.TransformPoint.