mirror of
https://github.com/konvajs/konva.git
synced 2026-01-22 21:02:26 +08:00
update docs
This commit is contained in:
15
src/Tween.ts
15
src/Tween.ts
@@ -158,11 +158,15 @@ class TweenEngine {
|
|||||||
* @example
|
* @example
|
||||||
* // instantiate new tween which fully rotates a node in 1 second
|
* // instantiate new tween which fully rotates a node in 1 second
|
||||||
* var tween = new Konva.Tween({
|
* var tween = new Konva.Tween({
|
||||||
|
* // list of tween specific properties
|
||||||
* node: node,
|
* node: node,
|
||||||
* rotationDeg: 360,
|
|
||||||
* duration: 1,
|
* duration: 1,
|
||||||
* easing: Konva.Easings.EaseInOut,
|
* easing: Konva.Easings.EaseInOut,
|
||||||
* onFinish: () => console.log('finished')
|
* onUpdate: () => console.log('node attrs updated')
|
||||||
|
* onFinish: () => console.log('finished'),
|
||||||
|
* // set new values for any attributes of a passed node
|
||||||
|
* rotation: 360,
|
||||||
|
* fill: 'red'
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* // play tween
|
* // play tween
|
||||||
@@ -445,7 +449,7 @@ export class Tween {
|
|||||||
if (this.onUpdate) {
|
if (this.onUpdate) {
|
||||||
this.onUpdate.call(this);
|
this.onUpdate.call(this);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* play
|
* play
|
||||||
@@ -539,9 +543,8 @@ export class Tween {
|
|||||||
* circle.to({
|
* circle.to({
|
||||||
* x : 50,
|
* x : 50,
|
||||||
* duration : 0.5,
|
* duration : 0.5,
|
||||||
* onFinish: () => {
|
* onUpdate: () => console.log('props updated'),
|
||||||
* console.log('finished');
|
* onFinish: () => console.log('finished'),
|
||||||
* }
|
|
||||||
* });
|
* });
|
||||||
*/
|
*/
|
||||||
Node.prototype.to = function (params) {
|
Node.prototype.to = function (params) {
|
||||||
|
|||||||
Reference in New Issue
Block a user