Reputation: 576
Here is an example: http://jsfiddle.net/zQQ6P/11/
The relevant part:
line.transitionTo({
points: [{ x: 100, y: 100}, { x: 200, y: 200 }],
strokeWidth: 30,
duration: 1
});
This does not seem to work. If points is commented out, it works. Is this KineticJS limitation or am I doing something wrong?
Upvotes: 1
Views: 288
Reputation: 11755
The only things that are transitionTo-able in kineticjs are numeric values, for example, you cannot transition colors, because they are not numeric.
On the same note, the points attribute is not numeric, although it does contain numbers, it is an object, an array of x,y values.
The only thing you can do at this point, until a feature like you want is created is something like this: http://jsfiddle.net/zQQ6P/12/
Eric Drowell has listed points being transitional as a possible add-on to be released in KineticJS 4.3.2
but right now you can only use
line.setPoints(); // see the jsfiddle
Upvotes: 1