Skip to content

Instantly share code, notes, and snippets.

@C4Code
Created July 21, 2012 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save C4Code/3154626 to your computer and use it in GitHub Desktop.
Save C4Code/3154626 to your computer and use it in GitHub Desktop.
Animated Mask Over Camera
//
// 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