Check what is under the graph/mask

I’m creating a graph and applying a mask, but I want to apply an event to an item so that when it passes over this mask, it can see what’s underneath. I tried using addMoveCallback, but it always triggers the mouse pointer. Do you have any event alternatives?

example I followed: sprites/mask – Phaser CE Examples

If you want to know when the pointer is over an interactive game object, there’s onInputOver and onInputOut. But no masks are involved.

If you want to know when a circle intersects something else, you’ll probably have to use one of the Phaser.Circle “intersects” methods. And you can convert a sprite to a bounding box (Phaser.Rectangle) with getBounds().

1 Like

in this case I want to use a magnifying glass to go over another object that has a mask, the magnifying glass checks what is under this masked object.

I used bound to position the mask on the object.

in the example link sprites/mask – Phaser CE Examples, he is using the addMoveCallback function, but he only assigns this action to the mouse pointer, I want to assign this action to the magnifying glass.

addMoveCallback() is for input pointers, because it comes from the browser mousemove and touchmove events.

1 Like

Do you know of any solution similar to this example ? to visualize what is under the mask, one only needs to use x and y ?

This was eventually solved, aim was

1 Like