Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Moon013

macrumors newbie
Original poster
Jul 14, 2008
23
0
i uses core animation. I uses this to make it animate from a place to the other:

CABasicAnimation *animation;

animation = [CABasicAnimation animationWithKeyPath:mad:"position"];

animation.duration = duration;
animation.repeatCount = 1;
animation.fromValue = [NSValue valueWithCGPoint:from];
animation.toValue = [NSValue valueWithCGPoint:to];

what I want to do is when i touch an image while its animating, the image will stop at the center, and animation stops.

The problems faced are:
- How do I touch an image while its animation? the image x, y position does not change while its animating? it is based on what you put it when you alloc the image?

- how do i make it stop and put it at the center? Using transfrom to transform the image from its original position to the center of the screen?

Any help appreciated. Kind of noob here.

Chris
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.