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

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -