Kinetic.Animation constructor now just requires a function and optional node. No more config object

This commit is contained in:
Eric Rowell
2012-11-15 21:30:58 -08:00
parent 694ced6b7a
commit 1913fed33b
7 changed files with 25 additions and 40 deletions

View File

@@ -29,12 +29,9 @@ Test.Modules.ANIMATION = {
// in ms
var centerX = stage.getWidth() / 2 - 100 / 2;
var anim = new Kinetic.Animation({
func: function(frame) {
rect.setX(amplitude * Math.sin(frame.time * 2 * Math.PI / period) + centerX);
layer.draw();
}
});
var anim = new Kinetic.Animation(function(frame) {
rect.setX(amplitude * Math.sin(frame.time * 2 * Math.PI / period) + centerX);
}, layer);
var a = Kinetic.Animation;
test(a.animations.length === 0, 'should be no animations running');

View File

@@ -23,12 +23,9 @@ Test.Modules.TRANSITION = {
var period = 1000;
var centerX = 0;
var anim = new Kinetic.Animation({
func: function(frame) {
var anim = new Kinetic.Animation(function(frame) {
rect.setX(amplitude * Math.sin(frame.time * 2 * Math.PI / period) + centerX);
layer.draw();
}
});
}, layer);
anim.start();
anim.stop();