Welcome,
Guest
. Please
login
or
register
.
April 30, 2026, 09:07:01 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
relative touch position from the center of a sprite
« previous
next »
Print
Pages: [
1
]
Author
Topic: relative touch position from the center of a sprite (Read 2077 times)
tasoson
Guest
relative touch position from the center of a sprite
«
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
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: relative touch position from the center of a sprite
«
Reply #1 on:
October 18, 2013, 06:00:46 PM »
Math.
Knowing widget's position A and touch screen position B, convert widget's position to screen coordinates, and subtract one from the other.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
relative touch position from the center of a sprite