Commit c226d8b1 authored by rockyl's avatar rockyl

修改tween

parent 7dbeb2b0
......@@ -19,7 +19,7 @@ export default class BounceZoom extends ScillaComponent {
super.onAwake();
this._tween = createTween(this, this.transform, false,
{clazz: Vector2D, fields: ['x', 'y'], autoPlay: false}
{fields: ['x', 'y'], autoPlay: false}
)
.to({scale: this.targetScale.clone()}, this.duration * 0.5)
.to({scale: originScale.clone()}, this.duration * 0.5)
......
......@@ -27,10 +27,10 @@ export default class TouchZoom extends InteractComponent {
const scaleFrom = transform.scale.clone();
const scaleTo = transform.scale.clone().add(scaleOffset);
this._zoomIn = createTween(this, transform, false, {autoPlay: false, clazz: Vector2D, fields: ['x', 'y']})
this._zoomIn = createTween(this, transform, false, {autoPlay: false, fields: ['x', 'y']})
.to({scale: scaleTo}, duration, easeFunc);
this._zoomOut = createTween(this, transform, false, {autoPlay: false, clazz: Vector2D, fields: ['x', 'y']})
this._zoomOut = createTween(this, transform, false, {autoPlay: false, fields: ['x', 'y']})
.to({scale: scaleFrom}, duration, easeFunc);
}
}
......
......@@ -132,7 +132,7 @@ export default class ScrollView extends InteractComponent {
const targetPos = createVector2D(tx, ty);
const duration = Math.min(500, Math.max(targetPos.distance(position), 200));
createTween(this, this._contentTransform, true, {clazz: Vector2D, fields: ['x', 'y']})
createTween(this, this._contentTransform, true, {fields: ['x', 'y']})
.to({position: targetPos}, duration, ease.cubicOut);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment