Re: [SOLVED] Resetting of property values after completion of a CABasicAnimation
Re: [SOLVED] Resetting of property values after completion of a CABasicAnimation
- Subject: Re: [SOLVED] Resetting of property values after completion of a CABasicAnimation
- From: Bill Dudney <email@hidden>
- Date: Thu, 15 Nov 2007 09:30:57 -0700
Hi Steve,
Keep in mind that animation (by its self) is not changing the
underlying property. When you attach an animation to an object it will
make the animation happen but its up to you to make the change to the
'real' object. For example if you create a basic animation that moves
the frame.origin.x from 14 to 25 (i.e the fromValue is {14.0f, 35.0f}
and the toValue is {15.0f, 35.0f}) but the view is actually at {35.0f,
35.0f} and you set the new location to {19.0f, 35.0f} the animation
will move from 14 to 25. So the result will be flashing and popping
around. Initially the view will appear to jump to 14 (from 35) then
will smoothly animate to 25 then will jump to 19.
All that said I posted this;
http://bill.dudney.net/roller/objc/resource/TimedAnimaton.zip
example. I'll write up a blog post about it RSN but in the mean time,
run and go then click the right arrow key. The beach photo moves to
the snow photo then when its under the snow photo the snow photo
starts its animation and then moves to the far left.
Its not beautiful but I think it shows at least a way to do what you
are looking to do.
HTH,
-bd-
http://bill.dudney.net/roller/objc
On Nov 14, 2007, at 8:08 AM, Steve Sheets wrote:
On Nov 13, 2007, at 9:57 AM, email@hidden wrote:
second suggestion, using transactions worked like a charm. Problem
solved.
Dear Bill & Vincent (and everyone else),
While I am glad your code is doing what you want, your original
question never was answered. I am having similar problem, or at
least, I am having hard time understanding what is going on when
using CABasicAnimation.
All the sample documentation and examples use CABasicAnimation to
create an explicit animation from some property value (using
changing Opacity) to another value and then back again. They do not
show you how to explicitly animate a property value so that the
value stays changed.
I want to animate from value (in my case, the layer's position), and
have the value be valid at the end of the animation. When I use
CABasicAnimation animation to do this, the position of the layer
changes (a nice smooth animation), but then the layer jumps back to
it's original position.
Yes, I could use implicit animation to do similar effect, but I am
going to be grouping animations together, with different start
times, so I need to make it an explicit animation.
Can anyone explain what I am doing wrong?
Steve Sheets
Midnight Mage Software
_______________________________________________
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