AnimationController

AnimationController

new AnimationController(actor)

角色动画控制器

Source:
Parameters:
Name Type Description
actor Actor

绑定的角色对象

Members

active :boolean

角色动画控制器是否已激活

Source:
Type:
  • boolean

actor :Actor

绑定的角色对象

Source:
Type:

animation :Animation|null

绑定的角色动画

Source:
Type:

idleMotion :string

角色动画闲置动作名称

Source:
Type:
  • string

moveMotion :string

角色动画移动动作名称

Source:
Type:
  • string

playing :boolean

角色动画正在播放中

Source:
Type:
  • boolean

state :string

角色动画状态

Source:
Type:
  • string

Methods

bindAnimation(animationopt)

绑定角色动画

Source:
Parameters:
Name Type Attributes Description
animation Animation <optional>

动画实例

changeMotion()

改变角色动作

Source:

getCurrentMotionName()

获取当前动作名称

Source:

loadData(motions)

加载角色动作设定

Source:
Parameters:
Name Type Description
motions Object

playMotion(motionName, speed) → {Animation|undefined}

播放角色动作(结束时恢复动作)

Source:
Parameters:
Name Type Default Description
motionName string

动作名称

speed number 1

播放速度

Returns:
Type:
Animation | undefined

restart()

重新播放动作

Source:

saveData()

保存角色动作设定

Source:

startIdle()

开始闲置动作

Source:

startMoving()

开始移动动作

Source:

stopMotion()

停止播放角色动作

Source: