KeyframeAnimation
xr-frame / Exports / KeyframeAnimation
# Class: KeyframeAnimation
Keyframe
动画。
# Hierarchy
Animation
<IKeyframeAnimationData
,IKeyframeAnimationOptions
>↳
KeyframeAnimation
# Table of contents
# Constructors
- constructor
# Events
- onInit
- onPause
- onPlay
- onResume
- onStop
- onUpdate
# Properties
- clipNames
# Accessors
- scene
# Constructors
# constructor
• new KeyframeAnimation(_scene
, data
)
# Parameters
# Inherited from
Animation.constructor
# Events
# onInit
▸ onInit(data
): void
动画初始化时执行的生命周期,只会执行一次。
# Parameters
# Returns
void
# Inherited from
Animation.onInit
# onPause
▸ onPause(el
): void
在动画暂停时执行的回调。
# Parameters
# Returns
void
# Inherited from
Animation.onPause
# onPlay
▸ onPlay(el
, clipName
, options
): IKeyframeAnimationInfo
动画开始播放时执行的生命周期。
# Parameters
# Returns
IKeyframeAnimationInfo
返回本次播放片段的参数,必须包括时长duration
(s),可选循环次数loop
、延迟delay
和方向direction
。
# Inherited from
Animation.onPlay
# onResume
▸ onResume(el
): void
在动画从暂停状态唤醒时执行的回调。
# Parameters
# Returns
void
# Inherited from
Animation.onResume
# onStop
▸ onStop(el
): void
在动画停止时执行的回调。
# Parameters
# Returns
void
# Inherited from
Animation.onStop
# onUpdate
▸ onUpdate(el
, progress
, reverse
): void
在动画更新时执行的回调。
# Parameters
# Returns
void
# Inherited from
Animation.onUpdate
# Properties
# clipNames
• clipNames: string
[]
动画所有的片段名字,必须在onInit
中被初始化。
# Inherited from
Animation.clipNames
# Accessors
# scene
• get
scene(): Scene
场景实例。
# Returns
Scene