Sign in to follow this  
rhennig

Change event priority

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!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.