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
// PuruBtn.h | |
#import "CCSpriteBtn.h" | |
@interface PuruBtn : CCSpriteBtn{} | |
@end |
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
PuruBtn *b = [[PuruBtn alloc] initWithFiles:@"b_border80.png" ro:@"b_border80_on.png"]; | |
[b addListner:self selector:@selector(onPress:)]; | |
[self addChild: b]; |
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
// PuruBtn.m | |
#import "PuruBtn.h" | |
@implementation PuruBtn | |
- (void)_init | |
{ | |
[self schedule:@selector(tick:) interval: 1.0f];//初回は一秒後に実行 | |
} | |
- (void)tick:(ccTime) dt | |
{ | |
//プルプルさせる処理 |
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
-(void) _init; | |
-(void) _press; | |
-(void) _release; |
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
PuyoBtn *b = [[PuyoBtn alloc] initWithFiles:@"b_border80.png" ro:@"b_border80_on.png"]; | |
[b addListner:self selector:@selector(onPress:)]; | |
[self addChild: b]; |
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
// PuyoBtn.m | |
#import "PuyoBtn.h" | |
@implementation PuyoBtn | |
enum{ | |
kTagSequence, | |
}; | |
- (void)_press | |
{ | |
//release時のアクションを実行中の場合はキャンセルします | |
[self stopActionByTag:kTagSequence]; |
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
// PuyoBtn.h | |
#import "CCSpriteBtn.h" | |
@interface PuyoBtn : CCSpriteBtn{} | |
@end |
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 - ToggleBtn | |
CCSpriteBtn *b2 = [[CCSpriteBtn alloc] initToggleWithFiles:@"b_border80.png" toggle:@"b_border80_on.png"]; | |
b2.Id = 2; | |
b2.position = ccp( b2.contentSize.width/2 , stage.height - b2.contentSize.height/2 - 98 ); |
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 - 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 ); |
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 ); |