/**
* name
*/
module game{
export class Tween extends Laya.Image{
constructor(){
super();
Laya.stage.frameLoop(100,this,function(){
console.log(this.x);
})
Laya.Tween.to(this,{x:500,y:500},6000,Laya.Ease.backInOut);
console.log(this.x);
}
}
}
内部定义
static to(target: any, props: any, duration: number, ease?: Function, complete?: Handler, delay?: number, coverBefore?: boolean, autoRecover?: boolean): Tween;
/**
* 从props属性,缓动到当前状态。
* @param target 目标对象(即将更改属性值的对象)。
* @param props 变化的属性列表,比如
* @param duration 花费的时间,单位毫秒。
* @param ease 缓动类型,默认为匀速运动。
* @param complete 结束回调函数。
* @param delay 延迟执行时间。
* @param coverBefore 是否覆盖之前的缓动。
* @param autoRecover 是否自动回收,默认为true,缓动结束之后自动回收到对象池。
* @return 返回Tween对象。