move on touch event

Is there a way to move an object about its axis to the direction of touch ?Suppose when I click on left the object should move to left about its axis or when I click on right side it should move to right side about its axis.

Yes there is. You touch function would have to take into account the touches location relative to the object and change the rotation based on that. Its actually really simple:x = touch.x - obj.x, y = touch.y - obj.y , find degrees using artan2 and adjust rotation accordingly. You might have to add or subtract some degrees in order to get the correct rotation.

views:1371 update:2011/12/29 9:44:01
corona forums © 2003-2011