Skip to content

Instantly share code, notes, and snippets.

@is8r
Created June 27, 2014 13:42
Show Gist options
  • Save is8r/ff6149f5ac5de4ed3dd0 to your computer and use it in GitHub Desktop.
Save is8r/ff6149f5ac5de4ed3dd0 to your computer and use it in GitHub Desktop.
-(id) init
{
if( (self=[super init])) {
//
CGSize stage = [[CCDirector sharedDirector] winSize];
//btn - onRelease
CCSpriteBtn *b1 = [[CCSpriteBtn alloc] initWithFiles:@"b_border80.png" ro:@"b_border80_on.png"];
b1.Id = 1;
b1.position = ccp( b1.contentSize.width/2 , stage.height - b1.contentSize.height/2 - 49 );
[b1 addListnerRelease:self selector:@selector(onRelease:)];
[b1 addLabel:@"onRelease"];
[self addChild: b1];
}
return self;
}
-(void) onRelease:(CCSpriteBtn*)sender
{
NSLog(@"onRelease:%i", sender.Id);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment