Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >Modify view animation while running (From: Daniel Gobera <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.