Jump to content

Phaser Button onInputOver doesn't fire for a short time after a click


VincentMeier
 Share

Recommended Posts

The Phaser buttons seem to have a bug, as onInputOver doesn't fire for a short time after any part of the game area is clicked. This becomes a problem very often for me, since I'm making a menu for my game and when I click on 'New game' button for instance, 3 save file buttons pop up and if I move my mouse over one of them the highlighting effect doesn't appear. And I also have a UI that shows the description of what the button does to the player on mouse over, which doesn't appear in this situation since the onInputOver hasn't fired.

 

You might be thinking that perhaps I'm holding the click down as I move the mouse, but no, I have let go of the click even before moving the mouse.

 

I made a simple code to test if this happens even in simple situations, to check if my own code isn't somehow creating this behaviour and yes it still the case. Here is the code, a video with audio cues on when I click and how the button highlighting doesn't happen after the click.

 

https://www.youtube.com/watch?v=Hzdh4tl8DF8

var game = new Phaser.Game(window.innerWidth, window.innerHeight, Phaser.AUTO, '', { preload: preload, create: create, update: update });function preload() {    game.load.spritesheet('main_menu_game', 'assets/menu_items/main_menu_game.png', 128, 40);}function create() {    var button;    button = game.add.button(30, 30, 'main_menu_game', function () {    }, this, 1, 0);    button.events.onInputOver.add(function () {    }, this);    button.events.onInputOut.add(function () {    }, this);    button = game.add.button(200, 80, 'main_menu_game', function () {    }, this, 1, 0);    button.events.onInputOver.add(function () {    }, this);    button.events.onInputOut.add(function () {    }, this);}function update() {}
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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