Created
January 23, 2013 03:50
-
-
Save C4Code/4601770 to your computer and use it in GitHub Desktop.
Example showing how to add multiple objects to the canvas or any other visible object.
This file contains hidden or 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 | |
// | |
#import "C4WorkSpace.h" | |
@implementation C4WorkSpace { | |
C4Shape *s; | |
C4Image *i; | |
C4Movie *m; | |
C4Camera *c; | |
C4Label *l; | |
UIView *v; | |
UIScrollView *sv; | |
UIButton *b; | |
} | |
-(void)setup { | |
i = [C4Image imageNamed:@"C4Sky"]; | |
m = [C4Movie movieNamed:@"inception.mov"]; | |
b = [UIButton buttonWithType:UIButtonTypeContactAdd]; | |
s = [C4Shape rect:CGRectMake(0, 0, 10, 10)]; | |
l = [C4Label labelWithText:@"hi"]; | |
v = [[UIView alloc] initWithFrame:CGRectMake(20, 0, 10, 10)]; | |
sv = [[UIScrollView alloc] initWithFrame:CGRectMake(40, 0, 10, 10)]; | |
[i addObjects:@[m,b,s,l,v,sv]]; | |
[self.canvas addImage:i]; | |
[i addGesture:PAN name:@"pan" action:@"move:"]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment