Custom path animation for CAShapeLayer
Custom path animation for CAShapeLayer
- Subject: Custom path animation for CAShapeLayer
- From: Kenneth Baxter <email@hidden>
- Date: Sat, 08 Jan 2011 00:07:17 +0000 (GMT)
Hi, I'm trying to use a CAShapeLayer for some paths in my application. For the most part this works fine, but in some circumstances the animation from one path to another looks really strange during the animation.
I would be able to tell it what the path should be at any intermediate point in the animation, but I'm not sure how to get access to it to provide those paths.
Is it possible to provide my own paths for the animation, or get some callback when it wants a new path or the animation advances?
If not, what's my best approach for animating the layer? I have played around with the idea of creating a dummy key which I add an animation for and animate it between 0 and 1, and set setNeedsDisplayForKey: to return YES for that key, and then use the value to determine how far through the animation I am and draw the appropriate path, but this seems a really counter-intuitive (hackish) way of doing it, but it seems to work and I haven't yet found a better way...
(target is Mac OS X 10.6)
Thanks.
Ken
_______________________________________________
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