KineticJS. Drag shape and move all group

169 views Asked by At

I am new to KineticJS. I want to make something similar to this example: http://www.html5canvastutorials.com/kineticjs/html5-canvas-drag-and-drop-a-group-with-kineticjs/

My problem is that I only want the purple rectangle to be draggable, not all the group, but I want that the rest of the rectangles move together with the purple rectangle when I drag it.

Thanks for your help.

1

There are 1 answers

0
truefusion On

In other words, you want only the purple rectangle to be "listening" for events? Then disable it for every other rectangle, e.g. if (colors[i] != 'purple') box.listening(false);