Re: Animating a view along a path
Re: Animating a view along a path
- Subject: Re: Animating a view along a path
- From: douglas welton <email@hidden>
- Date: Fri, 15 Aug 2008 13:36:12 -0400
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 (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