`
rayln
  • 浏览: 431365 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

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];


变速动画!!


CCMoveTo *m = CCMoveTo::create(1.0f, ccp(480,160));
CCEaseBackIn *bm = CCEaseBackIn::create(m);
sprite->runAction(bm);
  • 大小: 52.1 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics