LineGrowthComponent()

new LineGrowthComponent()

线生长动画组件类构造函数,用于通过操作UV坐标控制线条的生长动画效果。

Members

progress :number

获取当前线生长动画进度。进度值范围为0到1。

reversal :boolean

设置线生长方向是否反转。

Methods

play(optionsopt)

播放线生长动画。
Parameters:
Name Type Attributes Default Description
options object <optional>
{} 动画参数。
Properties
Name Type Attributes Default Description
time number <optional>
1000 动画持续时间,单位为毫秒。
delayTime number <optional>
0 动画开始前的延迟时间。
lerpType THING.LerpType <optional>
THING.LerpType.Linear.None 动画缓动类型。
loopType THING.LoopType <optional>
动画循环类型。
repeatTimes number <optional>
1 动画重复次数。
progress number <optional>
1 动画进度值,取值范围为0到1。
onComplete function <optional>
动画完成时触发的回调函数。
complete function <optional>
动画完成时触发的备用回调函数。
Example
lineGrowth.play({
  time: 2000,        // 动画持续2秒
  delayTime: 500,    // 延迟0.5秒开始
  repeatTimes: 3,    // 重复3次
  progress: 0.8      // 动画播放到线条的80%
});

setProgress(value)

设置线生长进度。
Parameters:
Name Type Description
value number 进度值范围为0到1。