stop pause and resume CAAnimation
stop pause and resume CAAnimation
- Subject: stop pause and resume CAAnimation
- From: Kevin Barnes <email@hidden>
- Date: Tue, 4 Dec 2007 10:39:36 -0600
- Importance: Normal
Hi everyone,
I'm trying to use the animator proxy to modify the size and position of a view, but I want to be able to set the start, end and duration of the animation. I have got this working by using the following code:
NSDictionary *nsdict = [widget animations];
CABasicAnimation *originAnim = [CABasicAnimation animationWithKeyPath:@"frameOrigin"];
CABasicAnimation *sizeAnim = [CABasicAnimation animationWithKeyPath:@"frameSize"];
[dict setValue:sizeAnim forKey:@"frameSize"];
[dict setValue:originAnim forKey:@"frameOrigin"];
originAnim.fromValue= NSValue valueWithPoint:NSMakePoint(300, 300)];
originAnim.toValue = [NSValue valueWithPoint:NSMakePoint(50, 30)];
sizeAnim.fromValue= [NSValue valueWithSize:NSMakeSize(100, 30)];
sizeAnim.toValue = [NSValue valueWithSize:NSMakeSize(350, 30)];
originAnim.duration = 5.0f;
sizeAnim.duration = 5.0f;
NSRect frameRect = NSMakeRect(50, 30, 350, 30);
[[widget animator] setFrame:frameRect];
My problem is that I would like to be able to stop, pause and resume the animation before it has finished. I haven't found a way to do this yet. Has anyone solved this problem, or have any suggestions?
Kevin
_________________________________________________________________
Introducing the City @ Live! Take a tour!
http://getyourliveid.ca/?icid=LIVEIDENCA006_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden