updated Transition docs

This commit is contained in:
Eric Rowell
2012-06-03 10:36:50 -07:00
parent e842cdf8ac
commit 8b22fb0690
5 changed files with 46 additions and 49 deletions

36
dist/kinetic-core.js vendored
View File

@@ -3,7 +3,7 @@
* http://www.kineticjs.com/
* Copyright 2012, Eric Rowell
* Licensed under the MIT or GPL Version 2 licenses.
* Date: Jun 02 2012
* Date: Jun 03 2012
*
* Copyright (C) 2011 - 2012 by Eric Rowell
*
@@ -1069,7 +1069,7 @@ Kinetic.Node.prototype = {
var trans = new Kinetic.Transition(this, config);
var anim = {
func: function() {
trans.onEnterFrame();
trans._onEnterFrame();
},
node: node
};
@@ -4568,8 +4568,10 @@ Kinetic.Transform.prototype = {
*/
/**
* Transition constructor. KineticJS transitions contain
* multiple Tweens
* Transition constructor used by KineticJS. The transitionTo() Node method
* returns a reference to the transition object which you can use
* to stop, resume, or restart the transition
* @constructor
*/
Kinetic.Transition = function(node, config) {
this.node = node;
@@ -4586,12 +4588,11 @@ Kinetic.Transition = function(node, config) {
addTween(c[key], attrs[key]);
}
else {
that.add(that._getTween(attrs, key, c[key]));
that._add(that._getTween(attrs, key, c[key]));
}
}
}
}
addTween(config, node.attrs);
var finishedTweens = 0;
@@ -4610,13 +4611,6 @@ Kinetic.Transition = function(node, config) {
* Transition methods
*/
Kinetic.Transition.prototype = {
/**
* add tween to tweens array
* @param {Kinetic.Tween} tween
*/
add: function(tween) {
this.tweens.push(tween);
},
/**
* start transition
*/
@@ -4625,14 +4619,6 @@ Kinetic.Transition.prototype = {
this.tweens[n].start();
}
},
/**
* onEnterFrame
*/
onEnterFrame: function() {
for(var n = 0; n < this.tweens.length; n++) {
this.tweens[n].onEnterFrame();
}
},
/**
* stop transition
*/
@@ -4649,6 +4635,14 @@ Kinetic.Transition.prototype = {
this.tweens[n].resume();
}
},
_onEnterFrame: function() {
for(var n = 0; n < this.tweens.length; n++) {
this.tweens[n].onEnterFrame();
}
},
_add: function(tween) {
this.tweens.push(tween);
},
_getTween: function(key, prop, val) {
var config = this.config;
var node = this.node;

File diff suppressed because one or more lines are too long

View File

@@ -706,7 +706,7 @@ Kinetic.Node.prototype = {
var trans = new Kinetic.Transition(this, config);
var anim = {
func: function() {
trans.onEnterFrame();
trans._onEnterFrame();
},
node: node
};

View File

@@ -6,8 +6,10 @@
*/
/**
* Transition constructor. KineticJS transitions contain
* multiple Tweens
* Transition constructor used by KineticJS. The transitionTo() Node method
* returns a reference to the transition object which you can use
* to stop, resume, or restart the transition
* @constructor
*/
Kinetic.Transition = function(node, config) {
this.node = node;
@@ -24,12 +26,11 @@ Kinetic.Transition = function(node, config) {
addTween(c[key], attrs[key]);
}
else {
that.add(that._getTween(attrs, key, c[key]));
that._add(that._getTween(attrs, key, c[key]));
}
}
}
}
addTween(config, node.attrs);
var finishedTweens = 0;
@@ -48,13 +49,6 @@ Kinetic.Transition = function(node, config) {
* Transition methods
*/
Kinetic.Transition.prototype = {
/**
* add tween to tweens array
* @param {Kinetic.Tween} tween
*/
add: function(tween) {
this.tweens.push(tween);
},
/**
* start transition
*/
@@ -63,14 +57,6 @@ Kinetic.Transition.prototype = {
this.tweens[n].start();
}
},
/**
* onEnterFrame
*/
onEnterFrame: function() {
for(var n = 0; n < this.tweens.length; n++) {
this.tweens[n].onEnterFrame();
}
},
/**
* stop transition
*/
@@ -87,6 +73,14 @@ Kinetic.Transition.prototype = {
this.tweens[n].resume();
}
},
_onEnterFrame: function() {
for(var n = 0; n < this.tweens.length; n++) {
this.tweens[n].onEnterFrame();
}
},
_add: function(tween) {
this.tweens.push(tween);
},
_getTween: function(key, prop, val) {
var config = this.config;
var node = this.node;

View File

@@ -1365,13 +1365,22 @@ Test.prototype.tests = {
radius: 70,
fill: 'red',
stroke: 'black',
strokeWidth: 4
strokeWidth: 4,
//detectionType: 'pixel'
});
circle.draggable(true);
/*
circle.on('dragend', function() {
circle.saveData();
});
*/
layer.add(circle);
stage.add(layer);
//circle.saveData();
},
'DRAG AND DROP - drag and drop stage': function(containerId) {
var stage = new Kinetic.Stage({