In my screensaver, I use layers and explicit animations to animate the bounds 
(size) of the layer.
At some point, I'd like to pause the animation.
I am trying to do that by setting the duration of the animation to a very large 
value.
The effect is that the layer still changes its bounds , i.e., it grows and  
shrinks  -- 
however, the screensaver's animateOneFrame() function does not get called any 
more.

(Code snippets below)

Any ideas why that is?
All insights and hints will be appreciated.

Best regards, 
Gabriel.


Code snippets:


This is how I create and set the animation:

       CALayer * imgLayer = [CALayer layer];
...
        CABasicAnimation * anim = [CABasicAnimation animationWithKeyPath: 
@"bounds.size"];
        anim.duration   = 30.0;
...
        [imgLayer addAnimation: anim forKey: @"myBoundsAnim"];
       CABasicAnimation * fadein = [CABasicAnimation animationWithKeyPath: 
@"opacity"];
 ...
        [imgLayer addAnimation: fadein forKey: nil];
        [mainLayer_ addSublayer: imgLayer];
        currentLayer_ = imgLayer;                               // this is an 
ivar



This is how I am trying to pause the zooming animation in the  -animateOneFrame 
 method of the screensaver:

        CAAnimation * zoominganim = [ currentLayer_ animationForKey: 
@"myBoundsAnim" ];
        zoominganim.duration = 1e100;            
 




_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to