Created
March 13, 2013 02:44
-
-
Save gregtemp/5148998 to your computer and use it in GitHub Desktop.
subview addShape + mask
not quite sure what to do with this but it looks cool.
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 | |
// Examples | |
// | |
// Created by Greg Debicki. | |
// | |
@implementation C4WorkSpace { | |
C4Shape *s1, *s2, *m; | |
} | |
-(void)setup { | |
[self setupShapes]; | |
m.mask = s1; | |
[s1 addShape:s2]; | |
[self.canvas addShape:m]; | |
} | |
-(void)setupShapes { | |
m = [C4Shape ellipse:CGRectMake(0, 0, 300, 300)]; | |
s1 = [C4Shape rect:CGRectMake(0, 0, m.height*2, m.height/5)]; | |
s2 = [C4Shape rect:CGRectMake(0, 0, m.height/5, m.height*2)]; | |
m.center = self.canvas.center; | |
s1.center = CGPointMake(m.width/2 ,m.height/2); | |
s2.center = CGPointMake(s1.width/2 ,s1.height/2); | |
m.lineWidth = 10; | |
m.fillColor = [UIColor clearColor]; | |
s1.animationDuration = 1.71f; | |
s1.rotation -= PI; | |
s1.animationOptions = REPEAT; | |
s2.animationDuration = 2.23f; | |
s2.rotation += TWO_PI; | |
s2.animationOptions = REPEAT | AUTOREVERSE; | |
} | |
@end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment