Skip to content

Instantly share code, notes, and snippets.

@C4Tutorials
Created April 10, 2013 16:32
Show Gist options
  • Save C4Tutorials/5356221 to your computer and use it in GitHub Desktop.
Save C4Tutorials/5356221 to your computer and use it in GitHub Desktop.
Rotating with an offset anchorPoint
//
// C4WorkSpace.m
//
// Created by Travis Kirton
//
#import "C4WorkSpace.h"
@implementation C4WorkSpace
-(void)setup {
C4Image *img1 = [C4Image imageNamed:@"C4Sky"];
C4Image *img2 = [C4Image imageNamed:@"C4Table"];
img1.width = 180;
img2.width = 180;
img2.anchorPoint = CGPointMake(-1.0f,0.5f);
img1.center = self.canvas.center;
img2.center = self.canvas.center;
[self.canvas addObjects:@[img1,img2]];
img1.rotation = QUARTER_PI;
img2.rotation = QUARTER_PI;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment