Animation with CALayer?
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