Created
June 27, 2014 13:43
-
-
Save is8r/6705c010dcd52cd81d71 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
// PuyoBtn.m | |
#import "PuyoBtn.h" | |
@implementation PuyoBtn | |
enum{ | |
kTagSequence, | |
}; | |
- (void)_press | |
{ | |
//release時のアクションを実行中の場合はキャンセルします | |
[self stopActionByTag:kTagSequence]; | |
//ちょっと拡大します | |
id step0; | |
id easeAction; | |
CCSequence* sequence; | |
step0 = [CCScaleTo actionWithDuration:0.1f scale:1.1f]; | |
easeAction = [CCEaseElasticOut actionWithAction:step0]; | |
sequence = [CCSequence actions:step0, easeAction, nil]; | |
sequence.tag = kTagSequence; | |
[self runAction:sequence]; | |
} | |
- (void)_release | |
{ | |
//_press時のアクションを実行中の場合はキャンセルします | |
[self stopActionByTag:kTagSequence]; | |
//元の大きさに戻します | |
id step0; | |
id easeAction; | |
CCSequence* sequence; | |
step0 = [CCScaleTo actionWithDuration:0.3f scale:1.0f]; | |
easeAction = [CCEaseElasticOut actionWithAction:step0]; | |
sequence = [CCSequence actions:step0, easeAction, nil]; | |
sequence.tag = kTagSequence; | |
[self runAction:sequence]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment