Re: Modify view animation while running
Re: Modify view animation while running
- Subject: Re: Modify view animation while running
- From: Bill Cheeseman <email@hidden>
- Date: Sat, 11 Nov 2006 17:18:38 -0500
- Thread-topic: Modify view animation while running
on 2006-11-11 3:04 PM, Daniel Gobera at email@hidden wrote:
> Does anybody know if it is possible to change the target frame of an
> NSViewAnimation while it is running?
I've been fiddling with similar issues the last few days, but not exactly
the same one you're asking about. So far, my impression is that you can do
just about anything you want to do with NSViewAnimation, but sometimes it
requires clever and indirect approaches. I've had particular success with
NSAnimation delegate methods and with subclassing NSViewAnimation to control
drawing at each iteration.
I don't know whether you can change the endFrame midstream. If not, two
other possible approaches suggest themselves to me.
1. Subclass NSViewAnimation and override -setCurrentProgress: per the
documentation. I do this to control the transparency of a view while it's
moving, but I'm thinking you might be able to control the drawing of the
view frame despite what endFrame thinks the current view frame is.
2. Break your animations into shorter pieces, each piece taking the view
only part way toward the last user click. If there's no second user click,
just keep stringing the animations together until the view gets to its final
destination. But if there is an intervening user click, start using a new
animation with a new endFrame as soon as the current leg ends. How short you
have to make the legs to yield a smooth result will be a matter of trial and
error.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden