Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: tasoson on October 18, 2013, 12:11:56 AM

Title: relative touch position from the center of a sprite
Post by: tasoson on October 18, 2013, 12:11:56 AM
Hi,

I am making a d-pad for an action game.
I want to get the relative touch position from the center of d-pad sprite to determine a direction, but I have no idea.

Could you help me? Thanks
Title: Re: relative touch position from the center of a sprite
Post by: ArenMook on October 18, 2013, 06:00:46 PM
Math. :P

Knowing widget's position A and touch screen position B, convert widget's position to screen coordinates, and subtract one from the other.