javascript - Moving a KineticJS line with a transition -


i using fantastic kineticjs javascript framework illustrations.

i have number of tweens in illustrations funky transitions.

my problem am trying move kinetic.line() object across illustration smoothly.

the docs kineticjs can use tweens transition "any numeric property of shape". know points in kinetic.line() object not numeric, object property. there way access kline_movingline.attrs.points[0].x used in tween.

my lines simple. have 2 points (from , points).

you can still tween line tween shape changing it's properties!

var line = new kinetic.line({   x: 100,   y: 100,   points: [0, 0, 50, 50],   stroke: '#ff0000' });  var tween = new kinetic.tween({   node: line,   duration: 1,   x: 400,   y: 30,   points: [100, 50, 25, 0] }); 

in above example, used tween change x, y , points properties. check fiddle , see works expected: jsfiddle


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -