Re: Animation and crossfading of windows
Re: Animation and crossfading of windows
- Subject: Re: Animation and crossfading of windows
- From: Shaun Wexler <email@hidden>
- Date: Sat, 31 Jul 2004 11:04:11 -0700
On Jul 31, 2004, at 3:38 AM, Oskar Lissheim-Boethius wrote:
We all know how the System Preferences "window-morphing" looks. It
resizes the window to exactly fit the new panel and at the same time
cross-fade the content of the old and new one. Very spiffy.
How do this in code? Is this yet another of Apple's mysterious
"cooler-than-any-other" GUI-tricks? I know how to do the
window-morphing works, but have never seen info about the cross-fading
of contents.
NSWindow can animate its frame changes, and you can register for
notifications to be received at every redraw. Cache a NSImage of the
before- and after- content views, and during an animated resize in
-drawRect: simply dissolve between them using a fraction based on the
before/after frame size ratio, rather than drawing the actual window
content. Notice that the System Preferences window is a fixed width,
and as each new pane fades in, it stays attached to the window origin
in the bottom left when animating the frame... simple? ;)
--
Shaun Wexler
MacFOH
http://www.macfoh.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.