Re: Group CGAffineTransform Animations?
Re: Group CGAffineTransform Animations?
- Subject: Re: Group CGAffineTransform Animations?
- From: WT <email@hidden>
- Date: Wed, 17 Jun 2009 23:48:41 +0200
On Jun 17, 2009, at 11:28 PM, David Duncan wrote:
On Jun 17, 2009, at 1:58 PM, WT wrote:
my understanding was that the OP wanted to do all three operations
concurrently. Of course, if he wants simply to move, then scale,
and then rotate, there are easier ways to accomplish that than to
use transforms.
You can set the center & transform of a view within the same
animation block and both animations will occur concurrently.
Yes, of course! Duh... in my haste to answer, I misunderstood what you
said in your previous post. Your comment provides the clearest and
cleanest solution:
CGRect screenBounds = [[UIScreen mainScreen] bounds];
CGPoint screenCenter = { CGRectGetMidX(screenBounds),
CGRectGetMidY(screenBounds) };
[UIView beginAnimations: nil context: NULL];
[UIView setAnimationDuration: kAnimDuration];
[UIView setAnimationDelegate: self];
[UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];
CGAffineTransform transform;
transform = CGAffineTransformMakeScale(kScaleX, kScaleY);
transform = CGAffineTransformRotate(transform,
DEGS_TO_RADS(kAngleInDegrees));
imgView.transform = transform;
imgView.center = screenCenter;
[UIView commitAnimations];
For future reference and for the benefit of the OP, I've now updated
my sample project.
Wagner
_______________________________________________
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