Jump to content

Phaser buttons working the wrong way


Recommended Posts

When phaser button is pressed and the input is released outside of the button, the button is still considered as pressed in phaser. The traditional way to handle this would be that the button is only consiredered as pressed if the touch begins and ends in the area of button.


This is the way user can cancel pressing the button if he/she so desires by moving the finger/mouse somewhere outside of the button area, but at the moment this is not possible. 


This is the way I am currently using buttons. Is there another way to do this, so it would work like i would want it to?

this.button = this.game.add.button(0,0, 'level_button', function(){            console.log("button is pressed");},this);

I am using 2.20 RC2 at the moment, but it has worked like this since I started with phaser (2.0.7). You can see the same behaviour in phaser examples, f.e. in this: http://examples.phaser.io/_site/view_full.html?d=buttons&f=action+on+click.js&t=action%20on%20click


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.

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.


  • Recently Browsing   0 members

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