Simply, I'm trying to rotate an image about its center, as a person drags their finger around the center. Though the twist is that it rotates in 30 degree increments. It also must know it's rotational location in respect to it's starting orientation.
I'm trying to create a rotating object for the iPhone. I have it calculating all the trig. The problem is that for my project I have need to have the program reset the x and y every time a finger is dragged more over then 30 degrees around the center point. Whenever I link a variable to the x and y of the current location within the touchesMoved function they link permanently and continually change along with the drag event instead of staying constant and updating every 30 degrees. Is there a way to statically store an x and y?
Thanks Everyone.
Comment:
Tried using CGPointMake and it still linked and updated.
Code:
currentpoint = [touch locationInView:self.view];
when angle between startpoint and currentpoint >= 30 degrees
set altpoint = currentpoint,
I did that using CGPointMake and it didn't work.
altpoint continually updated to currentpoint
I'm trying to create a rotating object for the iPhone. I have it calculating all the trig. The problem is that for my project I have need to have the program reset the x and y every time a finger is dragged more over then 30 degrees around the center point. Whenever I link a variable to the x and y of the current location within the touchesMoved function they link permanently and continually change along with the drag event instead of staying constant and updating every 30 degrees. Is there a way to statically store an x and y?
Thanks Everyone.
Comment:
Tried using CGPointMake and it still linked and updated.
Code:
currentpoint = [touch locationInView:self.view];
when angle between startpoint and currentpoint >= 30 degrees
set altpoint = currentpoint,
I did that using CGPointMake and it didn't work.
altpoint continually updated to currentpoint