Created
July 21, 2012 04:54
-
-
Save C4Code/3154626 to your computer and use it in GitHub Desktop.
Animated Mask Over Camera
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 | |
// camera test | |
// | |
// Created by Travis Kirton on 12-07-20. | |
// Copyright (c) 2012 POSTFL. All rights reserved. | |
// | |
#import "C4WorkSpace.h" | |
@implementation C4WorkSpace { | |
C4Camera *c1; | |
C4Image *img; | |
} | |
-(void)setup { | |
img = [C4Image imageNamed:@"mask.png"]; | |
c1 = [C4Camera cameraWithFrame:CGRectMake(0, 0, 200, 200)]; | |
c1.mask = img; | |
[self.canvas addSubview:c1]; | |
[c1 initCapture]; | |
[self runMethod:@"test" afterDelay:0.1]; | |
} | |
-(void)test { | |
img.animationDuration = 1.0f; | |
img.animationOptions = AUTOREVERSE | REPEAT; | |
img.frame = CGRectMake(-100,-100,400,400); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment