It looks like you're new here. If you want to get involved, click one of these buttons!
scurvyrat
Member
blockRect = (Bitmap.new(Texture.new("images/transparentBlock.png"))) self:addChild(blockRect) blockRect:setX(1500))) blockRect:addEventListener(Event.MOUSE_DOWN, blockClicks,e) function blockClicks(e) print(e.x,e.y,e.target,e.type) e:stopPropagation() end |
Comments
Try adding the following extension methods to Sprite:
I thought it might be faster to move the sprite's X value as opposed to creating/destroying it. Does anyone know if that is true?
Since the ignoreTouchHandler() function stops the event propagation for ALL the events it gets, whether or not they are within the shield sprite bounds or not, then it will block all the events from any of the other objects.
If you want to see the effect in action, download that BhPopup class from the link above.
Best regards
So, move the Sprite won't work. The bitmap continues to get click event because all mouse events always received by all Sprite (including it's descentdant e.g. Bitmap) whereever the mouse events occur. In your case, you can filter mouse event position by using Sprite:hitTestPoint