mirror of
https://github.com/konvajs/konva.git
synced 2025-11-18 17:21:36 +08:00
round 1 of animation + transition rewrite, while combing Xaric's Tween port
This commit is contained in:
@@ -10,7 +10,7 @@ function log(message) {
|
||||
* Test constructor
|
||||
*/
|
||||
function Test() {
|
||||
this.testOnly = '';
|
||||
this.testOnly = 'TRANSITION - transition position and rotation';
|
||||
this.counter = 0;
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -19,12 +19,26 @@ Test.prototype.tests = {
|
||||
layer.add(rect);
|
||||
stage.add(layer);
|
||||
|
||||
rect.transitionTo({
|
||||
x: 400,
|
||||
y: 30,
|
||||
rotation: Math.PI * 2,
|
||||
duration: 1
|
||||
var tween = new Kinetic.Transition(rect, function(i) {
|
||||
rect.setScale(i);
|
||||
}, Kinetic.Transitions.bounceEaseOut, 10, 1, 2);
|
||||
|
||||
stage.onFrame(function(frame) {
|
||||
tween.onEnterFrame();
|
||||
layer.draw();
|
||||
});
|
||||
|
||||
tween.start();
|
||||
stage.start();
|
||||
|
||||
/*
|
||||
rect.transitionTo({
|
||||
x: 400,
|
||||
y: 30,
|
||||
rotation: Math.PI * 2,
|
||||
duration: 1
|
||||
});
|
||||
*/
|
||||
},
|
||||
'TRANSITION - transition position and rotation with two transitions': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
|
||||
Reference in New Issue
Block a user