Skip to content

Instantly share code, notes, and snippets.

@takuma104
Created April 25, 2010 17:46
Show Gist options
  • Select an option

  • Save takuma104/378573 to your computer and use it in GitHub Desktop.

Select an option

Save takuma104/378573 to your computer and use it in GitHub Desktop.
#import "flalib.h"
@interface TestSprite : FLSprite {
}
@end
@implementation TestSprite
- (id)init {
if ((self = [super init])) {
UIImage *image = [UIImage imageNamed:@"test256x256.png"];
FLBitmapData *bitmapData = [FLBitmapData bitmapDataWithUIImage:image];
FLBitmap *bitmap = [FLBitmap bitmap:bitmapData];
bitmap.x = 10;
bitmap.y = 10;
[self addChild:bitmap];
FLShape *shape = [FLShape shape];
[shape.graphics beginFill :0xff0000 :0.5f];
[shape.graphics drawCircle :0 :0 :20.f];
[shape.graphics endFill];
[shape.graphics beginFill :0x00ff00 :0.5f];
[shape.graphics drawCircle :40 :40 :30.f];
[shape.graphics endFill];
[shape.graphics beginFill :0x0000ff :0.5f];
[shape.graphics drawCircle :100 :100 :70.f];
[shape.graphics endFill];
[bitmapData draw:shape];
}
return self;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment