views:

23

answers:

2

Hello,

I am trying to animate an NSPanel derived window with a fade-in while sliding (moving from outside to inside the screen) What is way to do a such animation?

Thanks in advance for your help,

Regards,

+2  A: 

I have never done this on my own. And while I think that sliding should be fairly enough, here's an attempt:

  • You need a non-opaque window. Use setOpaque: and set it to NO
  • The windows's content view should be layer-backed. Use setWantsLayer: and set to YES (at least during the animation).
  • Then you can get the window's content view's layer: [[window contentView] layer]
  • Animate the layers opacity using CoreAnimation techniques alongside the window's frame
Max Seelemann
A: 

NSViewAnimation can do both at once, and it works on windows, not just views.

Peter Hosey