Hello! I'm back making another ZIM game after a long time away, and it's great!
I have defined a blob area that I'd like to be clickable like an Image Map. When I set the alpha to zero the area stops handling clicks. Is there a workaround to make blobs invisible and clickable, please?
ZIM has clear and faint as colors. The clear is invisible and can't be clicked on. The faint is alpha .01 which is the lowest alpha that can be clicked on - so you can use that - it will probably do. You can also use the expand() method but that will use the bounding box - rectangle. It allows you to click invisible stuff as it applies a createjs hitArea. For the expand, it will automatically add 20 pixels but set the first parameter to 0 to not expand beyond the bounding box.
Thanks for your input @abstract, I had tried setting the opacity to 1% but the areas were showing up faintly as it was hard to match the blob colors to the varying background.
Instead I've decided to make my hit areas circles and use Pythagoras to determine whether the click coordinates are within each circle. It has the added benefit of significantly reducing the number of click listeners to one and simplifying the hit tests compared with my original complex blob shapes.
That sounds like a good solution. We have hitTestCircles that does a calculation between two circles but just realized a hitTestCirclePoint(x,y) could be handy to calculate a point in a circle. And I guess hitTestRectPoint(). Will add them to Requests and dwell...