Re: Animating a view along a path
Hi Chilton, There are a couple of examples of doing just that in the CA book (disclaimer: I'm the author) showing how to animate views with keyframe animations. http://www.pragprog.com/titles/bdcora The basic idea is to set the path for the keyframe animation and then put that animation on the boundsOrigin property of the view. When the boundsOrigin is changed it will use the animation to do the change (assuming you use the animator proxy). HTH, -bd- On Aug 14, 2008, at 5:26 PM, Chilton Webb wrote: Hi, I am using Core Animation Layer Backed NSViews in an app. I'd like to make one animation occur along a path. I know I can do this with just Core Animation Layers, but can I do this with a layer backed NSView ? Anyone have any example code of how to do this? Thank you, -Chilton Webb ___ 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/bdudney%40mac.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: Animating a view along a path
Are you able to just use CoreAnimation directly? Like, CAKeyframeAnimation? I've never used it, but the header seems to imply it'd apply to the problem you're trying to solve. On Aug 15, 2008, at 10:36 AM, douglas welton wrote: Chilton, Ultimately a "curve" is just a lot of straight line, really, really, really close to each other ; ^} Check out the "Animation Programming Guide for Cocoa" to see how you can link multiple animations together. Remember, you can also vary the rate of animation as well as the animation property (in this case the view's frame). You may want to work with that rate variance to create a "non-linear" affect. This may be easier (more effective?) than just working in 2D space. later, douglas On Aug 15, 2008, at 12:06 PM, Chilton Webb wrote: Hi Douglas! Thanks for writing. I realize this isn't something people do too much of, so any help would be greatly appreciated. On Aug 15, 2008, at 9:45 AM, douglas welton wrote: How complex is your path? if it's linear, why not just tell the view's animator to do it? That's the trick. I'm using linear paths now, and they just don't look as awesome as I'd like them to. I'd like to use a curve. If it's more complex, you might want to check out NSAnimation and NSViewAnimation (particularly the progress marks and delegates in these two classes) Okay, I'll do that. And that would work for views, too, right? Have you taken a look at the CocoaSlides sample code? Is this the type of thing you are trying to do? Yes, I've looked at it a bit. It appears they're setting locations and using the views' animators to perform linear movement to the destination coordinates. Unfortunately, that doesn't help, as it's what I'm already doing. I want to do things like 'hop' a view (like bouncing--with a tiny vertical offset) from Point A to Point B instead of just sliding it smoothly between them. Thanks! -Chilton ___ 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/luesang%40apple.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: Animating a view along a path
Chilton, Ultimately a "curve" is just a lot of straight line, really, really, really close to each other ; ^} Check out the "Animation Programming Guide for Cocoa" to see how you can link multiple animations together. Remember, you can also vary the rate of animation as well as the animation property (in this case the view's frame). You may want to work with that rate variance to create a "non-linear" affect. This may be easier (more effective?) than just working in 2D space. later, douglas On Aug 15, 2008, at 12:06 PM, Chilton Webb wrote: Hi Douglas! Thanks for writing. I realize this isn't something people do too much of, so any help would be greatly appreciated. On Aug 15, 2008, at 9:45 AM, douglas welton wrote: How complex is your path? if it's linear, why not just tell the view's animator to do it? That's the trick. I'm using linear paths now, and they just don't look as awesome as I'd like them to. I'd like to use a curve. If it's more complex, you might want to check out NSAnimation and NSViewAnimation (particularly the progress marks and delegates in these two classes) Okay, I'll do that. And that would work for views, too, right? Have you taken a look at the CocoaSlides sample code? Is this the type of thing you are trying to do? Yes, I've looked at it a bit. It appears they're setting locations and using the views' animators to perform linear movement to the destination coordinates. Unfortunately, that doesn't help, as it's what I'm already doing. I want to do things like 'hop' a view (like bouncing--with a tiny vertical offset) from Point A to Point B instead of just sliding it smoothly between them. Thanks! -Chilton ___ 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 [EMAIL PROTECTED]
Re: Animating a view along a path
Hi Douglas! Thanks for writing. I realize this isn't something people do too much of, so any help would be greatly appreciated. On Aug 15, 2008, at 9:45 AM, douglas welton wrote: How complex is your path? if it's linear, why not just tell the view's animator to do it? That's the trick. I'm using linear paths now, and they just don't look as awesome as I'd like them to. I'd like to use a curve. If it's more complex, you might want to check out NSAnimation and NSViewAnimation (particularly the progress marks and delegates in these two classes) Okay, I'll do that. And that would work for views, too, right? Have you taken a look at the CocoaSlides sample code? Is this the type of thing you are trying to do? Yes, I've looked at it a bit. It appears they're setting locations and using the views' animators to perform linear movement to the destination coordinates. Unfortunately, that doesn't help, as it's what I'm already doing. I want to do things like 'hop' a view (like bouncing--with a tiny vertical offset) from Point A to Point B instead of just sliding it smoothly between them. Thanks! -Chilton ___ 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 [EMAIL PROTECTED]
Re: Animating a view along a path
Chilton, How complex is your path? if it's linear, why not just tell the view's animator to do it? If it's more complex, you might want to check out NSAnimation and NSViewAnimation (particularly the progress marks and delegates in these two classes) Have you taken a look at the CocoaSlides sample code? Is this the type of thing you are trying to do? curiously, douglas On Aug 14, 2008, at 7:26 PM, Chilton Webb wrote: Hi, I am using Core Animation Layer Backed NSViews in an app. I'd like to make one animation occur along a path. I know I can do this with just Core Animation Layers, but can I do this with a layer backed NSView ? Anyone have any example code of how to do this? Thank you, -Chilton Webb ___ 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 [EMAIL PROTECTED]