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().
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
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