Skip to content

Instantly share code, notes, and snippets.

@robmerrell
Created May 4, 2012 03:29
Show Gist options
  • Save robmerrell/2591779 to your computer and use it in GitHub Desktop.
Save robmerrell/2591779 to your computer and use it in GitHub Desktop.
// TODO can we get rid of these?
// Create a texture for non selected and selected points
unselected_point = [[SPTexture alloc] initWithWidth:200 height:200 draw:^(CGContextRef context) {
CGContextSetLineWidth(context, 2.0f);
CGContextSetRGBFillColor(context, 0.7f, 0.7f, 0.7f, 1.0f);
CGContextSetRGBStrokeColor(context, 0.7f, 0.7f, 0.7f, 1.0f);
CGRect circlePoint = (CGRectMake(0.0f, 0.0f, 8.0f, 8.0f));
CGContextFillEllipseInRect(context, circlePoint);
}];
[[TextureManager sharedTextureManager] cacheTexture:unselected_point withName:@"unselected_point"];
selected_point = [[SPTexture alloc] initWithWidth:200 height:200 draw:^(CGContextRef context) {
CGContextSetLineWidth(context, 2.0f);
CGContextSetRGBFillColor(context, 0.0f, 1.0f, 1.0f, 1.0f);
CGContextSetRGBStrokeColor(context, 0.0f, 1.0f, 1.0f, 1.0f);
CGRect circlePoint = (CGRectMake(0.0f, 0.0f, 8.0f, 8.0f));
CGContextFillEllipseInRect(context, circlePoint);
}];
[[TextureManager sharedTextureManager] cacheTexture:selected_point withName:@"selected_point"];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment