Re: Pausing an animation

2019-09-19 Thread Gabriel Zachmann via Cocoa-dev
> Setting just the speed will often return you to the “beginning of time” for 
> your CAMediaTiming compliant object (CALayer and CAAnimation the most common 
> compliant objects).

I think, this is what must have happened in my case.
(It's just funny that it did not happen with one animation/layer, but with 
slightly different layers/animations it did happen.)

> 
> QA1673 has a proper implementation for doing this 
> 

That seems to work like a charm!
Thanks a million for the pointer.


Best regards, Gabriel




smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Pausing an animation

2019-09-17 Thread David Duncan via Cocoa-dev


> On Sep 17, 2019, at 1:19 PM, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> I have a layer with two animations.
> 
> I would like to pause this animation occasionally .
> To do so, I set layer.speed = 0.0;
> 
> In the past, this has worked (with slightly different animations).
> However, in this case, the layer seems to just disappear. 
> (the layer occupies the whole screen, and when I set speed-0, the screen is 
> black)
> 
> Does anyone have an idea what might be the reason why it doesn't work?
> Are there properties that do not work with speed = 0?

Setting just the speed will often return you to the “beginning of time” for 
your CAMediaTiming compliant object (CALayer and CAAnimation the most common 
compliant objects).

 = ( - beginTime) * speed + timeOffset

So if you want to pause a layer, you also need to set the timeOffset to a value 
that matches the current value of 

QA1673 has a proper implementation for doing this 
>

> 
> Thanks a lot in advance.
> Gabriel.
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/david.duncan%40apple.com
> 
> This email sent to david.dun...@apple.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Pausing an animation

2019-09-17 Thread Gabriel Zachmann via Cocoa-dev
I have a layer with two animations.

I would like to pause this animation occasionally .
To do so, I set layer.speed = 0.0;

In the past, this has worked (with slightly different animations).
However, in this case, the layer seems to just disappear. 
(the layer occupies the whole screen, and when I set speed-0, the screen is 
black)

Does anyone have an idea what might be the reason why it doesn't work?
Are there properties that do not work with speed = 0?

Thanks a lot in advance.
Gabriel.




smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com