My rootLayer was using the view's bounds, etc. so this works now:

rootLayer = [CALayer layer];

rootLayer.frame = CGRectMake(240, 160, 240, 160) ;*//self.view.bounds;*

[self.view.layer addSublayer:rootLayer];


boxPath = CGPathCreateMutable();

CGPoint center = CGPointMake(0,0);*//self.view.center;*

*
*

*...*

*
*

**
*

CABasicAnimation *rotationAnimation;

rotationAnimation =[CABasicAnimation animationWithKeyPath:@
"transform.rotation.z"];

[rotationAnimation setFromValue:DegreesToNumber(0)];

[rotationAnimation setToValue:DegreesToNumber(360)];

[rotationAnimation setDuration:2.0f];

[rotationAnimation setRepeatCount:10000];

[shapeLayer addAnimation:rotationAnimation forKey:@"rotate"];
*


This stuff is awesome - it's good that my PNG solution didn't look very good
which led me down this path of which I am learning now.

Thanks,
Eric



On Thu, Dec 3, 2009 at 3:40 PM, David Duncan <david.dun...@apple.com> wrote:

> On Dec 3, 2009, at 12:34 PM, Eric E. Dolecki wrote:
>
> > [shapeLayer setAnchorPoint:CGPointMake(240, 160)];
> >
> > It just rotates around the top left corner (meaning it comes into and out
> of
> > view)... I am looking to simply spin the shape where it sits from it's
> > center.
>
> The anchorPoint is in a unit coordinate system. When you specify a point
> outside of that system, the results are undefined.
>
> Specify something between 0,0 and 1,1.
> --
> David Duncan
> Apple DTS Animation and Printing
>
>


-- 
http://ericd.net
Interactive design and development
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to