首页 > 代码库 > Cocos2d-x 3.0 动作

Cocos2d-x 3.0 动作

http://blog.csdn.net/lnb333666/article/details/16858635
//运行一个action动作对象  
    runAction("action对象");    
      
    //暂停一个对象的动作  
    Director::sharedDirector()->getActionManger()->pauseTarget("对象");  
      
    //暂停全部对象的动作  
    Director::sharedDirector()->getActionManager()->pauseAllRunningActions();  
      
    //暂停全部对象的动作及其更新函数  
    pauseSchedulerAndActions();  
      
    //继续一个对象的动作  
    Director::sharedDirector()->getActionManager()->resumeTarget("对象");  
      
    //继续全部对象的动作  
    Director::sharedDirector()->getActionManager()->resumeTargets("CCSet对象");  
      
    //继续全部对象的动作及其更新函数  
    resumeSchedulerAndActions();  
      
    //停止对象的动作  
    stopAction("action对象");  
      
    //停止目标对象的动作  
    stopActionByTag("tag值");  
      
    //停止全部对象的动作  
    stopAllActions();  
      
    //删除动作对象  
    Director::sharedDirector()->getActionManager()->removeAction("action对象");  
      
    //删除动作对象  
    Director::sharedDirector()->getActionManager()->removeActionByTag("tag值");  
      
    //删除全部动作对象  
    Director::sharedDirector()->getActionManager()->removeAllActions();  
      
    //删除全部同样tag值得动作对象  
    Director::sharedDirector()->getActionManager()->removeAllActionsFromTarget("tag值");  
      
    //几秒后移动到坐标点  
    MoveTo::create("时间","坐标");  
      
    //几秒后移动到坐标点  
    MoveBy::create("时间","坐标");  
      
    //几秒后缩放到指定大小(1:原大小;大于1:放大;小于1:缩小)  
    ScaleTo::create("时间","缩放比例");  
      
    //几秒后缩放到指定大小(1:原大小;大于1:放大;小于1:缩小)  
    ScaleBy::create("时间","缩放比例");  
      
    //几秒后旋转多少度[0,360]  
    RotateTo::create("时间","角度");  
      
    //几秒后旋转多少度[0,360]  
    RotateBy::create("时间","角度");  
      
    //几秒后倾斜指定角度  
    SkewTo::create("时间","x轴角度","y轴角度");  
      
    //几秒后倾斜指定角度  
    SkewBy::create("时间","x轴角度","y轴角度");  
  
    //几秒后经过几次跳到指定位置  
    JumpTo::create("时间","目标位置","高度","到目标所需次数");  
      
    //几秒后经过几次跳到指定位置  
    JumpBy::create("时间","目标位置","高度","到目标所需次数");  
      
    //几秒内按指定贝塞尔曲线运动  
    BezierTo::create("时间","ccBezierConfig构造体");  
      
    //几秒内按指定贝塞尔曲线运动  
    BezierBy::create("时间","ccBezierConfig构造体");  
      
    //几秒后变为指定颜色  
    TintTo::create("时间","红","绿","蓝");  
      
    //几秒后变为指定颜色  
    TintBy::create("时间","红","绿","蓝");  
      
    //几秒内按曲线运动(拟合度0最柔和)  
    CardinalSplineTo::create("时间","控制点坐标数组","拟合度");  
  
    //几秒内按曲线运动(拟合度0最柔和)  
    CardinalSplineBy::create("时间","控制点坐标数组","拟合度");  
      
    //几秒内完毕一个样条插值轨迹(直线)  
    CatmullRomTo::create("时间","控制点坐标数组");  
      
    //几秒内完毕一个样条插值轨迹(直线)  
    CatmullRomBy::create("时间","控制点坐标数组");  
      
    //渐显  
    FadeIn::create("时间");  
  
    //渐消  
    FadeOut::create("时间");  
      
    //让目标动作具有反弹效果,从起点反弹  
    EaseBounceIn::create("action对象");  
      
    //让目标动作具有反弹效果,从终点反弹  
    EaseBounceOut::create("action对象");  
      
    //让目标动作具有反弹效果,起点终点都反弹  
    EaseBounceInOut::create("action对象");  
  
    //让目标动作具有回力效果,起点作为回力点  
    EaseBackIn::create("action对象");  
  
    //让目标动作具有回力效果,终点作为回力点  
    EaseBackOut::create("action对象");  
      
    //让目标动作具有回力效果,起点终点都作为回力点  
    EaseBackInOut::create("action对象");  
      
    //让目标动作具有弹力效果,起点具有弹性  
    EaseElasticIn::create("action对象");  
      
    //让目标动作具有弹力效果,终点具有弹性  
    EaseElasticOut::create("action对象");  
  
  
    //让目标动作具有弹力效果,起点终点都具有弹性  
    EaseElasticInOut::create("action对象");  
      
    //让目标动作缓慢開始  
    EaseExponentialIn::create("action对象");  
      
    //让目标动作缓慢结束  
    EaseExponentialOut::create("action对象");  
      
    //让目标动作缓慢開始并缓慢结束  
    EaseExponentialInOut::create("action对象");  
      
    //让目标动作由慢到快  
    EaseSineIn::create("action对象");  
      
    //让目标动作由快到慢  
    EaseSineOut::create("action对象");  
      
    //让目标动作由慢到快再到慢  
    EaseSineInOut::create("action对象");  
      
    //为目标动作设置速度  
    EaseRateAction::create("action对象","速度");  
      
    //为目标动作速度翻倍  
    Speed::create("action对象","倍数");  
      
    //多个不同类动作同一时候运行(NUll结尾)  
    Spawn::create("action对象1","action对象2".....);  
  
    //多个目标动作顺序运行(NUll结尾)  
    Sequence::create("action对象1","action对象2"......);  
      
    //几秒内闪烁几次  
    Blink::create("时间","次数");  
      
    //反复目标动作  
    Repeat::create("action对象","次数");  
  
    //永久反复目标动作  
    RepeatForever::create("action对象");  
      
    //延迟几秒运行(在顺序运行Sequence中延迟哦)  
    DelayTime::create("时间");  
  
    //镜头跟着目标走,超过范围就结束。  
    Follow::create("尾随对象","尾随范围");  
      
    //几秒内球面运动  
    OrbitCamera::create("时间","起始半径","半径差","起始z角","旋转z角","起始x角","旋转x角");  
      
    //创建一个回调动作(不带參数)  
    CallFunc::create("对象","回调函数");  
      
    //创建一个回调动作(传调用者为參数)  
    CallFuncN::create("对象","回调函数");  
      
    //创建一个回调动作(带2个參数)  
    CallFuncN::create("对象","回调函数","随意參数");