CC的各种动画

阅读更多
一共由几种
CCMoveBy CCMoveTo
CCScaleBy CCScaleTo
CCRotateBy CCRotateTo
CCSkewBy CCSkewTo
CCTintBy CCTintTo
CCJumpBy CCJumpTo
CCHide CCShow
CCFadeIn CCFadeout
CCToggleVisibility

CCCallFunc //回掉函数 CCCallFunc::create(this, callfunc_selector(HellWorld::test))
CCDelayTime //延迟时间

CCSequence //顺序播放动画
CCSpawn //一起播放动画
CCRepeat //重复动画 CCRepeat *repeat = CCRepeat::create(seq, 3) //cocos2d-x写法


使用方法:
CCMoveBy *action1 = [CCMoveBy actionWithDuration:1 position:CGPointMake(30, 30)];
[s runAction:action1];


或者:
CCMoveBy *action1 = [CCMoveBy actionWithDuration:1 position:CGPointMake(30, 30)];
    CCMoveTo *action2 = [CCMoveTo actionWithDuration:5 position:CGPointMake(200, 100)];
    
    CCSequence *se = [CCSequence actions:action1,action2, nil];
    [s runAction:se];


变速动画!!
CC的各种动画_第1张图片

CCMoveTo *m = CCMoveTo::create(1.0f, ccp(480,160));
CCEaseBackIn *bm = CCEaseBackIn::create(m);
sprite->runAction(bm);
  • CC的各种动画_第2张图片
  • 大小: 52.1 KB
  • 查看图片附件

你可能感兴趣的:(CC的各种动画)