Re: Modify view animation while running
Re: Modify view animation while running
- Subject: Re: Modify view animation while running
- From: Daniel Gobera <email@hidden>
- Date: Mon, 13 Nov 2006 15:06:01 -0800
Thanks for your suggestions.
Both seem reasonable and may be the only way to achieve exactly what
I want. However, the complexity of the implementation may exceed the
benefit here. My animations are .5 seconds long, so the chances that
the target state will change in the middle are pretty low. Also, each
NSViewAnimation is animating 3 views simultaneously, so it will be a
pain to calculate intermediate size and position for each if I
override setCurrentProgress (that's why I'm not using NSAnimation
directly).
From what I saw on the WWDC keynote, Core Animation will solve most
of the problems with current interface animation techniques, so I
guess I'll just wait.
Daniel
On Nov 11, 2006, at 2:18 PM, Bill Cheeseman wrote:
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
_______________________________________________
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