Jump to content

PointerEvents?


WombatTurkey
 Share

Recommended Posts

Is it possible to enable something similar to

pointer-events:none

(https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events) in phaser?

 

For example, if you draw a sprite on top of another graphic or sprite, or whatever but the below graphic has an onInputUp event on it, but you're clicking the graphic on top but you can still fire the event below it.

 

I've tried 

sprite.inputEnabled = false;

Edit: I've searched the forums for pointer events but it lead back to this topic lol

Link to comment
Share on other sites

I don't think there's any such thing as a general flag like you say, but have a look at this:

http://phaser.io/examples/v2/input/input-priority

 

Wow it does work. It's like a mini pointer events method.

b30b89b39ac1967e56a0d745c2fe178e.gif

 

I need it for skills because I don't want players clicking on skills and not being able to move to that particular point in the map. 

 

Thank you so much.

Link to comment
Share on other sites

BTW: Are those little Donald Trump heads? 'Cuz that's hilarious.

 

Placeholders yes. But I think I will have a future official skill called Trump Thrower or something. I need to look up on celebrity public usage laws first as I don't want to get sued / dmca'd  :(

 

:lol: Although, I don't think Trump minds the publicity  :P

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...