Skip to content

Instantly share code, notes, and snippets.

@C4Code
Created February 26, 2013 21:31
Show Gist options
  • Select an option

  • Save C4Code/5042399 to your computer and use it in GitHub Desktop.

Select an option

Save C4Code/5042399 to your computer and use it in GitHub Desktop.
Basic Shape Mask
//
// C4WorkSpace.m
//
// Created by Travis Kirton
//
#import "C4WorkSpace.h"
@implementation C4WorkSpace {
C4Image *image;
C4Shape *shape;
}
-(void)setup {
[self setupImageAndShape];
image.mask = shape;
}
-(void)setupImageAndShape {
image = [C4Image imageNamed:@"C4Table"];
image.center = self.canvas.center;
shape = [C4Shape ellipse:CGRectMake(0, 0, image.height, image.height)];
shape.center = CGPointMake(image.width/2,image.height/2);
[self.canvas addImage:image];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment