Jump to content

up event is not fired properly


dpxcc
 Share

Recommended Posts

I'm working on a mobile game with a virtual joystick, similar to the one in Phaser Examples. (http://phaser.io/examples/v2/input/virtual-gamecontroller)

I find that up event is only fired when the down event happens on the same sprite. This leads to very strange behavior, as you can see in that example:

You click down on the background, and move to the left button (your character starts moving), then you release the click (your character will keep moving)...

Link to comment
Share on other sites

If you just copied that example code directly, the problem is that the code is activating the buttons during onInputOver events.

Find the lines that contain:

events.onInputOver

And make sure they aren't activating the respective button's ability.

Link to comment
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...
 Share

  • Recently Browsing   0 members

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