Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: sirwalek on September 15, 2014, 07:29:08 AM
-
Hi all,
I am trying to make a steering wheel. I did it onGui with drawing textures. Now i want to do it with Ngui. But i couldnt figure out how to rotate steering wheel based on my touch moves. I couldnt find any tutorial about how to work with touch phases. What exactly i want to do is if my touch (in a spesifict rect) moves around a pivot point, i want to rotate steering wheel as u can imagine. I have no idea how to do that with NGUI. Any help, any tutorial link, any document to start would be great.
-
NGUI sends out OnDrag (Vector2 delta) events to you as you're dragging something. Determining the angle is a simple matter of doing some math. Knowing where you started, and where you are now, as well as the pivot point of the rotation, calculate the angle difference and rotate the object.