Created
June 27, 2014 13:42
-
-
Save is8r/7cc0e01595c0e8997a1b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(id) init | |
{ | |
if( (self=[super init])) { | |
// | |
CGSize stage = [[CCDirector sharedDirector] winSize]; | |
//btn - onPress | |
CCSpriteBtn *b0 = [[CCSpriteBtn alloc] initWithFiles:@"b_border80.png" ro:@"b_border80_on.png"]; | |
b0.Id = 0; | |
b0.position = ccp( b0.contentSize.width/2 , stage.height - b0.contentSize.height/2 ); | |
[b0 addListner:self selector:@selector(onPress:)]; | |
[b0 addLabel:@"onPress"]; | |
[self addChild: b0]; | |
} | |
return self; | |
} | |
-(void) onPress:(CCSpriteBtn*)sender | |
{ | |
NSLog(@"onPress:%i", sender.Id); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment