Re: Custom path animation for CAShapeLayer

2011-01-10 Thread Matt Neuburg
On Sat, 08 Jan 2011 00:07:17 + (GMT), Kenneth Baxter k.b.bax...@mac.com 
said:

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.


A path is not a concept that has a natural and obvious interpolation, so I 
presume you'd need to do the whole animation explicitly e.g. as a keyframe 
animation. Or maybe you could sort of cheat and animate some other property; 
you can create your own animatable property such that when you set it, your 
drawInContext: is called over and over as the value changes, so you could take 
that opportunity to redraw the path appropriately. m.

--
matt neuburg, phd = m...@tidbits.com, http://www.apeth.net/matt/
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.apeth.net/matt/default.html#applescriptthings___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Custom path animation for CAShapeLayer

2011-01-10 Thread David Duncan
On Jan 7, 2011, at 4:07 PM, Kenneth Baxter wrote:

 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.

Core Animation's path animation requires the source and destination paths to be 
of the same structure – that is you can animate between two lines, or two 
beziers but not from a line to a bezier (as such – you can generate degenerate 
bezier curves that look like lines to emulate this).

If your source  destination paths do not meet this requirement, you may get 
unexpected results.

 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.

The closest thing you could do here is use a Keyframe animation, but I'm not 
certain this could be done cleanly or without using lots of intermediate paths 
for even short sequences. It is something to explore.
--
David Duncan

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Custom path animation for CAShapeLayer

2011-01-10 Thread Kenneth Baxter

Thanks for the feedback David. I'll try the keyframe approach.

On 11 Jan, 2011,at 09:24 AM, David Duncan david.dun...@apple.com wrote:


The closest thing you could do here is use a Keyframe animation, but I'm not 
certain this could be done cleanly or without using lots of intermediate paths 
for even short sequences. It is something to explore.
--
David Duncan

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com