Re: Cross-fading between layers
Re: Cross-fading between layers
- Subject: Re: Cross-fading between layers
- From: Corbin Dunn <email@hidden>
- Date: Thu, 18 Oct 2012 10:33:00 -0700
On Oct 18, 2012, at 9:53 AM, Kyle Sluder <email@hidden> wrote:
> On Oct 18, 2012, at 8:50 AM, Gabriel Zachmann <email@hidden> wrote:
>
>> So far, I am fading out an existing layer, and fading in a new layer by the following 5 lines of code:
>>
>> [CATransaction begin];
>> [CATransaction setAnimationDuration: fading_duration];
>> [mainLayer_ replaceSublayer: currentLayer_ with: newlayer];
>> currentLayer_ = newlayer;
>> [CATransaction commit];
>>
>> This works fine under Lion, and it worked fine under Snow Leopard.
>>
>> It does not work any more under ML, i.e., the layers get replaced, but there is no cross-dissolve effect.
>
> My psychic powers tell me that mainLayer_'s delegate is an NSView instance.
I had that same inclination!
> Read the Mountain Lion release notes and watch the WWDC videos on implicit animations in AppKit using NSAnimationContext.
Yeah, those videos are great.
corbin
PS: NSAnimationContext.currentContext.allowsImplicitAnimations = YES;
>
>
> --Kyle Sluder
> _______________________________________________
>
> 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
_______________________________________________
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