Is it possible to somehow make a Matter JS body interactive? I want to apply the events pointerover
and pointerdown
to it.
Help would be greatly appreciated.
Is it possible to somehow make a Matter JS body interactive? I want to apply the events pointerover
and pointerdown
to it.
Help would be greatly appreciated.
I think it can be done to the game object (sprite), like any other.
I think it has no game object, at least the gameObject value is null. I use the fromPhysicsEditor
function.
How would this work with pointerover and pointerout when there is no reference to the game object? The only thing I could think of would be pointermove, but that would not be an ideal solution.
I rather wonder why gameObject is never defined. Could this be a bug? I also looked in the examples and gameObject is always null.
edit: Ok that seems to be intentional. What would be the best way to turn a Matter JS body into a game object?