Skip to content Skip to sidebar Skip to footer

Createjs Getobjectsunderpoint When Alpha = 0

I need to get all bitmaps under point in a container. The bitmaps alpha is set to 0 and this doesnt seem to work with this method. Are there any alternatives? I cant just add an ev

Solution 1:

1) If you just want to get the objects under a point you'd have to loop through all children of the container and call hitTest(x,y) (http://www.createjs.com/Docs/EaselJS/classes/DisplayObject.html#method_hitTest) this ignores the alpha-value. (remember to call the method with the coordinates in the object's local coordinate space)

2) If you want to work with EventListeners and Alpha-0 objects, you can define another DisplayObject as the hitArea (http://www.createjs.com/Docs/EaselJS/classes/DisplayObject.html#property_hitArea) - in that case only the shape, alpha, ect.. of the hitArea object is used.

Post a Comment for "Createjs Getobjectsunderpoint When Alpha = 0"