javascript - Add property to KineticJS object -
i know, how can add peoperties kineticjs object. example - create 2 rectangles , connect them line. , need object "line" knows 2 rectangles.
i create class connector atributtes object1, object2 , line (kinetic.line). can add canvas line, lost reference connector object, if tried line canvas - example after clicking on that.
if understand question correctly, simple
var rect1 = new kinetic.rect({...}); var rect2 = new kinetic.rect({...}); var line = new kinetic.line({...}); line.r1 = rect1; line.r2 = rect2;
now can access 2 rectangles using line.r1 , line.r2
Comments
Post a Comment