Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

click event on transparent rect with EaselJS

Tags:

easeljs

is it possible to make a transparent rect clickable? I don't want to fill it so it looks like

     shape.graphics.setStrokeStyle(2).beginStroke("#000").rect(0, 0, 100, 100)
like image 620
Misha Avatar asked May 30 '13 07:05

Misha


1 Answers

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;
like image 181
Misha Avatar answered Dec 11 '22 08:12

Misha