반응형
❛ Action에 Tag 주는 방법
[actionName setTag:...];
...
[spriteName getActionByTag:...]
❛ CCBezier (곡선이동)
ccBezierConfig bezier1;
bezier1.controlPoint_1 = ccp(120, 240);
bezier1.controlPoint_2 = ccp(240, 240);
bezier1.endPosition = ccp(360, 160);
id actionBezier = [CCBezierTo actionWithDuration:2.5 bezier:bezier1];
❛ CCBlink (깜박임)
❛ CCEaseIn / CCEaseOut / CCEaseInOut (내부액션 가속화 혹은 저속화)
❛ CCEaseExponentialIn / CCEaseExponentialOut / CCEaseExponentialOut (Ease 보다 가속도 심함)
❛ CCEaseElasticIn / CCEaseElasticOut / CCEaseElasticInOut (탄성효과)
❛ CCEaseBounce / CCEaseBounceIn / CCEaseBounceInOut (통통튀는 효과)
❛ CCFadeIn / CCFadeOut (농도변경)
❛ CCPlace (순간이동)
id myAction = [CCPlace actionWithPosition:ccp(250,200)];
❛ CCSpeed (속도조절)
spriteAple.position = ccp(actualX, winSize.height + (spriteAple.contentSize.height));
[self addChild:spriteAple z:kTag_Item];
id actionMove = [CCMoveTo actionWithDuration:2.0 position:ccp(actualX, 70)];
id actionEase = [CCEaseIn actionWithAction:[[actionMove copy]autorelease] rate:2.5];
id actionPause = [CCDelayTime actionWithDuration:0.1f];
id actionMoveDone = [CCCallFuncN actionWithTarget:self selector:@selector(spriteMoveFinished:)];
id actionSequence = [CCSequence actions: actionEase, actionPause, actionMoveDone, nil];
actionSpeed = [CCSpeed actionWithAction:actionSequence speed:speedRate];
[actionSpeed setTag:444];
[spriteAple runAction:actionSpeed];
[arrAple addObject:spriteAple];
...
for (CCSprite *apleS in arrAple) {
[(CCSpeed *)[apleS getActionByTag:444] setSpeed:speedRate];
}
❛ CCTint (색상조절)
CCTintTo : rgb 에 맞는 절대값으로 변화
CCTintBy : 현재의 값에서 rgb 변화
ex)
[CCTintBy actionWithDuration:5 red:0 green:-255 blue:-255]; // 빨간색으로 변화
[sprite setColor:ccc3(255, 255, 255)]; // 원래대로
반응형
'모바일 개발 > iOS' 카테고리의 다른 글
Xcode | 개발 (0) | 2020.02.27 |
---|---|
Xcode | 설치 및 환경설정 (0) | 2020.02.21 |
Cocos2d | 트러블 슈팅 (0) | 2020.02.20 |
Cocos2d | 기타 클래스 (0) | 2020.02.20 |
Cocos2d | 이미지 관련 클래스 (0) | 2020.02.20 |
Cocos2d | CCNode 클래스 (0) | 2020.02.20 |
Cocos2d | 기초 (0) | 2020.02.19 |
Cocos2d | 스프라이트 애니메이션 (0) | 2020.02.19 |
댓글