new require("zrender/animation/Animation")(options)
animation/Animation.js, line 55
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
optional
|
Example
var animation = new Animation();
var obj = {
x: 100,
y: 100
};
animation.animate(node.position)
.when(1000, {
x: 500,
y: 500
})
.when(2000, {
x: 100,
y: 100
})
.start('spline');
动画主类, 调度和管理所有动画控制器
Classes
Methods
-
add(clip)
animation/Animation.js, line 78 -
添加动画片段
Name Type Description clip
module:zrender/animation/Clip -
animate(target, options){module:zrender/animation/Animation~Animator}
animation/Animation.js, line 179 -
对一个目标创建一个animator对象,可以指定目标中的属性使用动画
Name Type Description target
Object options
Object Name Type Default Description loop
boolean false optional 是否循环播放动画
getter
function null optional 如果指定getter函数,会通过getter函数取属性值
setter
function null optional 如果指定setter函数,会通过setter函数设置属性值
-
clear()
animation/Animation.js, line 165 -
清除所有动画片段
-
remove(clip)
animation/Animation.js, line 85 -
删除动画片段
Name Type Description clip
module:zrender/animation/Clip -
start()
animation/Animation.js, line 141 -
开始运行动画
-
stop()
animation/Animation.js, line 159 -
停止运行动画
Type Definitions
-
IZRenderStageObject
-
Properties:
Name Type Description update
function