• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problem with CAAnimation in a screensaver
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with CAAnimation in a screensaver


  • Subject: Re: Problem with CAAnimation in a screensaver
  • From: Andreas Mayer <email@hidden>
  • Date: Thu, 29 Sep 2016 01:09:29 +0200

> Am 29.09.2016 um 01:01 schrieb Gabriel Zachmann <email@hidden>:
>
> Any ideas why that is?

The docs have example code on how to pause and resume an animation:

https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CoreAnimation_guide/AdvancedAnimationTricks/AdvancedAnimationTricks.html

------
Listing 5-4  Pausing and resuming a layer’s animations
-(void)pauseLayer:(CALayer*)layer {
   CFTimeInterval pausedTime = [layer convertTime:CACurrentMediaTime() fromLayer:nil];
   layer.speed = 0.0;
   layer.timeOffset = pausedTime;
}

-(void)resumeLayer:(CALayer*)layer {
   CFTimeInterval pausedTime = [layer timeOffset];
   layer.speed = 1.0;
   layer.timeOffset = 0.0;
   layer.beginTime = 0.0;
   CFTimeInterval timeSincePause = [layer convertTime:CACurrentMediaTime() fromLayer:nil] - pausedTime;
   layer.beginTime = timeSincePause;
}
------



_______________________________________________

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


References: 
 >Problem with CAAnimation in a screensaver (From: Gabriel Zachmann <email@hidden>)

  • Prev by Date: Re: Best way to make a little piece of data persistent?
  • Next by Date: Mystery Threads
  • Previous by thread: Problem with CAAnimation in a screensaver
  • Next by thread: Mystery Threads
  • Index(es):
    • Date
    • Thread