Click event on transparent rectangle with EaselJS

Can I make a transparent direct click? I do not want to fill it so that it looks like

shape.graphics.setStrokeStyle(2).beginStroke("#000").rect(0, 0, 100, 100) 
+6
source share
1 answer

here is the code how i did it:

 var shape = new createjs.Shape(); shape.graphics.setStrokeStyle(2).beginStroke("#000").rect(0, 0, 100, 100); var hit = new createjs.Shape(); hit.graphics.beginFill("#000").rect(0, 0, 100, 100); shape.hitArea = hit; 
+10
source

Source: https://habr.com/ru/post/946152/


All Articles