Jump to content

Change event priority


rhennig
 Share

Recommended Posts

Hello!

I'm having some troubles trying to change the priority of mouse clicks.

First I set:

this.input.onDown.add(function(){alert("world");}, this);

To catch mouse clicks on my entire game window and this works fine.

But sometimes I create sprites and I want them to have different mouse clicks events. For this I use:

this.spritetest.events.onInputDown.add(function(){alert("sprite");}, this,100);

My goal is to give priority to the sprite event function if clicked on a sprite and fire the "general function" if not. But the "general function" ever fires first!

I tried to set the priority parameter as you can see on the second function but this doesn't seem to change anything in my case.

Can someone points me how I can fix this?

Thanks!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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