Re: adding a page curl transition
Re: adding a page curl transition
- Subject: Re: adding a page curl transition
- From: Matt Neuburg <email@hidden>
- Date: Mon, 14 Sep 2009 18:11:10 -0700
- Thread-topic: adding a page curl transition
On Mon, 14 Sep 2009 09:32:11 -0700, Matt Neuburg <email@hidden> said:
>For example, I can imagine something like this. Take a "screen shot" of the
>window. Cover the whole window with a secondary window. Behind the secondary
>window, move the primary window on to the next entity. Take a second "screen
>shot" of the window. Now I *do* have a "before" and "after" pair of
>pictures. Perform the page curl animation in the secondary window, and
>remove it.
>
>That seems very elaborate, so before I do that I'm checking to see whether
>that strategy is on the right track. m.
Well, no one said it was a bad idea so that is what I ended up doing.
Actually, to be more precise, my current strategy, now pretty well fleshed
out, is as follows:
(1) At app launch I make an invisible child window with a layer, ignoring
mouse events, laid over the actual window. The user is unaware of its
existence. It's just a pane of glass; because it's a child window, it moves
with the main window.
(2) When the time comes to display another entity, I take a "screen shot" of
my main window and display that in the child window's layer, which is now
opaque, thus hiding the main window. The user doesn't see anything happen
because the image in the child window looks just like what was showing in
the main window.
(3) Now in the main window I display the other entity, but the user can't
see that; the child window and its layer are hiding it. Now I take a second
"screen shot" of my main window.
(4) Now I perform the animated transition in the layer, using the second
screen shot as the target image.
(5) Finally, after the animation is over, I turn the layer to transparent
glass once again. The user doesn't see anything happen because the contents
of the layer look just like the contents of the main window revealed behind
it.
The only problem with this approach so far is that the "screen shot" omits
the resize handle at the lower right of the window. I guess that's because
it isn't part of the window's content view. I'm using
cacheDisplayInRect:toBitmapImageRep: to take the "screen shot". Maybe
there's a better way? Apart from that, the illusion is extremely convincing.
m.
--
matt neuburg, phd = email@hidden, <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
_______________________________________________
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