Last active
December 16, 2015 00:49
-
-
Save C4Tutorials/5350254 to your computer and use it in GitHub Desktop.
Highlighting the center and origin of a square.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// C4WorkSpace.m | |
// | |
// Created by Travis Kirton and Greg Debicki. | |
// | |
#import "C4WorkSpace.h" | |
@implementation C4WorkSpace | |
-(void)setup { | |
C4Shape *square = [C4Shape rect:CGRectMake(0,0,192,192)]; | |
square.center = self.canvas.center; | |
[self.canvas addShape:square]; | |
C4Shape *c1, *c2; | |
c1 = [C4Shape ellipse:CGRectMake(0, 0, 20, 20)]; | |
c1.strokeColor = C4RED; | |
c1.fillColor = [UIColor clearColor]; | |
c2 = [c1 copy]; | |
c1.center = square.origin; | |
c2.center = square.center; | |
[self.canvas addObjects:@[square,c1,c2]]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment