Re: Animated button
Re: Animated button
- Subject: Re: Animated button
- From: "Ken Ferry" <email@hidden>
- Date: Tue, 26 Feb 2008 20:51:06 -0800
Or, if you had a sequence of CGImages you wanted to show in a loop,
you could do this to kick off the animation.
CAKeyframeAnimation *animation = [CAKeyframeAnimation
animationWithKeyPath:@"contents"];
animation.calculationMode = kCAAnimationDiscrete;
animation.values = arrayOfCGImageFrames;
animation.duration = PERIOD;
animation.repeatCount = FLT_MAX;
[[self layer] addAnimation:animation forKey:@"MyAnimation"];
-Ken
On Tue, Feb 26, 2008 at 3:50 PM, Bill Dudney <email@hidden> wrote:
> Hi,
>
> Sure...
>
> Make 2 layers one is the 'background' the other is the button (think
> the 'on/off' switch in time machine prefs pane)
> when the user clicks the button you switch it to the on or off
> position with buttonLayer.position = oppositePosition (a CGPoint)
>
> make sense?
>
> If not please feel free to ping and I'd be glad to elaborate.
>
> TTFN,
>
>
>
> -bd-
> http://bill.dudney.net/roller/objc
>
>
>
> On Feb 26, 2008, at 11:49 AM, I. Savant wrote:
>
> >> I'd suggest core animation as the easiest route but i'm sort of
> >> partial.
> >
> > For my own enlightenment, can you outline generally how this would
> > be accomplished with Core Animation? I'm very interested.
> >
> > --
> > I.S.
>
> _______________________________________________
>
> 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
>
_______________________________________________
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