• AnimationState 类型
    • 索引
      • 属性(properties)
      • 方法
  • Details
    • 属性(properties)
      • animator
      • curves
      • delay
      • repeatCount
      • duration
      • speed
      • wrapMode
      • time
      • clip
      • name
      • isPlaying
      • isPaused
        • 参数列表
      • onPlay
      • onPause
      • onResume
      • onStop
      • onError
        • 参数列表
      • play
      • stop
      • pause
      • resume
      • step

    AnimationState 类型

    继承于 Playable

    模块: cc

    AnimationState 完全控制动画播放过程。大多数情况下 动画组件 是足够和易于使用的。如果您需要更多的动画控制接口,请使用 AnimationState。

    索引

    属性(properties)
    • animator AnimationAnimator
    • curves Object[] 曲线列表。
    • delay Number 延迟多少秒播放。
    • repeatCount Number 迭代次数,指动画播放多少次后结束, normalize time。
    • duration Number 单次动画的持续时间,秒。
    • speed Number 播放速率。
    • wrapMode WrapMode 动画循环方式。
    • time Number 动画当前的时间,秒。
    • clip AnimationClip 此动画状态正在播放的剪辑。
    • name String 动画的名字
    • isPlaying Boolean 当前是否正在播放。
    • isPaused Boolean 当前是否正在暂停
    方法
    • constructor
    • onPlay
    • onPause
    • onResume
    • onStop
    • onError
    • play 播放动画。
    • stop 停止动画播放。
    • pause 暂停动画。
    • resume 重新播放动画。
    • step 执行一帧动画。

    Details

    属性(properties)

    animator

    metadescription
    类型AnimationAnimator
    定义于cocos2d/animation/animation-state.js:73
    curves
    曲线列表。
    metadescription
    类型Object[]
    定义于cocos2d/animation/animation-state.js:79
    delay
    延迟多少秒播放。
    metadescription
    类型Number
    定义于cocos2d/animation/animation-state.js:89
    repeatCount
    迭代次数,指动画播放多少次后结束, normalize time。 如 2.5(2次半)
    metadescription
    类型Number
    定义于cocos2d/animation/animation-state.js:100
    duration
    单次动画的持续时间,秒。
    metadescription
    类型Number
    定义于cocos2d/animation/animation-state.js:117
    speed
    播放速率。
    metadescription
    类型Number
    定义于cocos2d/animation/animation-state.js:127
    wrapMode
    动画循环方式。需要注意的是,动态修改 wrapMode 时,会重置 time 以及 repeatCount
    metadescription
    类型WrapMode
    定义于cocos2d/animation/animation-state.js:136
    time
    动画当前的时间,秒。
    metadescription
    类型Number
    定义于cocos2d/animation/animation-state.js:150
    clip
    此动画状态正在播放的剪辑。
    metadescription
    类型AnimationClip
    定义于cocos2d/animation/animation-state.js:441
    name
    动画的名字
    metadescription
    类型String
    定义于cocos2d/animation/animation-state.js:452
    isPlaying
    当前是否正在播放。
    metadescription
    类型Boolean
    定义于cocos2d/animation/playable.js:44
    isPaused
    当前是否正在暂停
    metadescription
    类型Boolean
    定义于cocos2d/animation/playable.js:56



    #### 方法



    ##### constructor


    metadescription
    定义于cocos2d/animation/animation-state.js:50
    参数列表
    • clip AnimationClip
    • name String
    onPlay
    metadescription
    定义于cocos2d/animation/playable.js:71
    onPause
    metadescription
    定义于cocos2d/animation/playable.js:76
    onResume
    metadescription
    定义于cocos2d/animation/playable.js:81
    onStop
    metadescription
    定义于cocos2d/animation/playable.js:86
    onError
    metadescription
    定义于cocos2d/animation/playable.js:91
    参数列表
    • errorCode string
    play

    播放动画。

    metadescription
    定义于cocos2d/animation/playable.js:100
    stop

    停止动画播放。

    metadescription
    定义于cocos2d/animation/playable.js:121
    pause

    暂停动画。

    metadescription
    定义于cocos2d/animation/playable.js:136
    resume

    重新播放动画。

    metadescription
    定义于cocos2d/animation/playable.js:148
    step

    执行一帧动画。

    metadescription
    定义于cocos2d/animation/playable.js:160