Re: Transition animation shows previous contents
Matt Neuburg <[email protected]>
| Newsgroups | gmane.comp.macosx.devel |
|---|---|
| Message-ID | <C6DA5B30.4DAF8%[email protected]> |
On Fri, 11 Sep 2009 22:55:58 +0200, Christiaan Hofman <[email protected]> said: >I am having problems showing a transitions using CoreAnimation. >Basically, I am doing the following: > >1. get a window containing a layer-hosting view (this is reused) >2. set the animation action for "contents" of the relevant layer to nil >3. set the contents of the layer to an initial CGImage >4. show the window >5. set the animation action for "contents" to a prepared CATransition >6. set the "contents" of the layer to a final CGImage > >The problem is that the transition animation I get starts from the >final image was from the /previous/ animation (or an empty image the >first time), rather than starting with the initial image I set in step >3. > >I have tried various NSView and CALayer setNeedsDisplay and display >methods in various places, but so far without any success. > >Could anyone please tell me what I forget? I don't know what you are forgetting, because I can't see your code. But what you describe is *exactly* what I am doing in my app, as I described here: http://www.cocoabuilder.com/archive/message/cocoa/2009/9/15/245084 It's working fine (in 10.6 only; in 10.5 it crashes, as I have described elsewhere). m. -- matt neuburg, phd = [email protected], <http://www.tidbits.com/matt/> A fool + a tool + an autorelease pool = cool! AppleScript: the Definitive Guide - Second Edition! http://www.tidbits.com/matt/default.html#applescriptthings