• 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
Animation with CALayer?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Animation with CALayer?


  • Subject: Animation with CALayer?
  • From: alex <email@hidden>
  • Date: Tue, 5 Feb 2008 12:30:03 -0800

Hi there,

Hopefully this is the right list for this question. I haven't found what I was looking for after searching the archives for the "right" way to animate some graphics using cocoa.

I'm trying to draw two different things. One of them is an audio level meter and the other is an effect similar to what the iPhone "slide" graphic does on the lock screen on the iPhone.
(I have a mask that I slide a white blob around behind.)


I'm able to do both with an NSTimer that fires and then I issue a [setNeedsDisplay] from the timer to update the animation. This works fine and produces the expected results but seems to use way too much CPU compared to what I've been able to do "back in the day" using straight CG or worse Quickdraw. (I am not porting this code from QD- I threw that code away, this is all new code.)

I've been looking at using CALayers to implement the drawing so that I can call [display] rather than [setNeedsDisplay] with the hopes that this would make the animations use less CPU.

What is the right way to approach this problem? (and please don't suggest using Shark to optimize my code as that is a given and will be done after I determine what the best course of code will be).

thanks,
alex

_______________________________________________

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


  • Follow-Ups:
    • Re: Animation with CALayer?
      • From: Bill Dudney <email@hidden>
  • Prev by Date: Re: ScreenSaverView and Core Animation
  • Next by Date: Itunes API/plugin
  • Previous by thread: Re: [[NSGarbageCollector defaultCollector] isEnabled] wrong?
  • Next by thread: Re: Animation with CALayer?
  • Index(es):
    • Date
    • Thread