Skip to content Skip to sidebar Skip to footer

Drag Shape Without Fill

I am trying to create an EaselJS app that lets me drag unfilled circles around the canvas - so instead of calling beginFill when I am setting up the Shape I would call beginStroke.

Solution 1:

Strokes and fills are necessary in EaselJS for masks. You could however assign an other Shape as hitArea:

var shape = new createjs.Shape();
 shape.graphics.beginFill("#000000").drawCircle(0, 0, 40);

 draggableCircle.hitArea = shape;

Keep in mind that the hitArea-Shape doesn't have to be added to the stage and thus won't be visible.

Post a Comment for "Drag Shape Without Fill"