Rotate an object.
Hi, i was just wondering. If i had a game where i wanted you to make an arrow switch directions, and if i split my screen in half, and declared in my touchesbegan method That the right half of the screen was Krighttouch and the left half Klefttouch , and i had a uiimage of an arrow (depicted as this in my post "--->" ) That sat in the middle of the screen pointing to the right. what would i do to rotate the arrow from facing the right to the left IF you touched the left side, and right if you touched the right side of the screen. for example,
If you touched the right side of the screen the arrow would look like this. --->
Or if you touched the left side of the screen the arrow would look like this <---
So basicly you would rotate the image 180 degrees on its Y axis if you touched / pushed your finger and held it down on the right or left side. any help would be greatly apreciated! Also, I searched the forum and i couldnt fidn information on what im doing specifically , and remember that it cant just be a line of code that says spin the object 180 degrees, because if the user pushes down and holds his/her finger on the screen, it will spam that and the image will just spin 360's. Thanks for your time!
Last edited by Doodl3; 03-18-2011 at 12:36 AM.
|