Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: terencekwan on October 02, 2012, 08:00:52 PM

Title: Calculate NGUI widget position to screen position
Post by: terencekwan 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
Title: Re: Calculate NGUI widget position to screen position
Post by: deathmtn on October 02, 2012, 09:17:27 PM
I think you may be able to just use something like icon.gameObject.transform.TransformPoint.