Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: zenmaster on April 13, 2013, 07:50:02 PM

Title: clicked position on a sprite
Post by: zenmaster on April 13, 2013, 07:50:02 PM
Hi All,

I have a Button with a background Sprite of a circular gauge.
OnClick() is getting called when I click on the button which i expect.
How do I get the clicked position on Sprite?
I was expecting all the event handlers to be passed an event object?

Thanks
Title: Re: clicked position on a sprite
Post by: Nicki on April 14, 2013, 08:37:55 AM
I think you can use

  1. UICamera.lastHit

to get a RaycastHit inside the OnClick.

You can also use

  1. UICamera.currentTouch

to get a "MouseOrTouch" instance that has a bunch of info. (see in the top of UICamera for definition).
Title: Re: clicked position on a sprite
Post by: zenmaster on April 15, 2013, 10:58:17 PM
Thanks for info.
lastTouchPosition has some coordinates that I still need to transform?
UICamera.lastHit has lots of data.