Jump to content

Search the Community

Showing results for tags 'Phaser.Button'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 2 results

  1. I'm trying to build a button for mobile devices with the following characteristics: The button goes down when there is a pointer in a down state over itThe button goes up when there are no pointers in a down state over itvar myButton = game.add.button(x,y,'myButton');myButton.inputEnabled = true;myButton.onInputDown.add(goDown,myButton);myButton.onInputOver.add(goDown,myButton);myButton.onInputUp.add(goUp,myButton);myButton.onInputOut.add(goUp,myButton);function goUp(){ this.isDown = false;}function goDown(){ this.isDown = true;}Everything works fine except for when the button goes down because of `onInputOver` but doesn't go up when the pointer goes up (in a mobile device, when a pointer goes over, it is necessarily in a down state). Apparently Phaser looks for `onUp` events only from pointers who were pressed directly on the button. How can I get the result I'm looking for?
  2. 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
×
×
  • Create New...