Vivern Posted June 13, 2014 Share Posted June 13, 2014 var customButton = game.add.sprite(game.world.centerX, game.world.centerY, 'button');customButton.inputEnabled = true;customButton.events.onInputOver.add(onBtnOver, customButton);customButton.events.onInputDown.add(onBtnDown, customButton);When touch custom button on ipad simultaneously activated events onInputOver and onInputDown, but should only onInputDown? Possible for mobile devices to use another (not events.onInput) input-touch system embedded in Phaser? Event onInputOver - used for Desktop. Link to comment Share on other sites More sharing options...
lewster32 Posted June 13, 2014 Share Posted June 13, 2014 Because touch devices have no concept of 'hover', they tend to fire the hover event at the same time as a touch in order to catch situations where a hover event has been set. When writing cross-platform code you should take into account whether the device is touch enabled (via the game.device.touch property, which will be true if a touch device is present) and alter your input methods accordingly. Link to comment Share on other sites More sharing options...
Vivern Posted June 13, 2014 Author Share Posted June 13, 2014 Thanks. >>When writing cross-platform code you should take into account whether the device is touch enabled (via the game.device.touch property, which will be true if a touch device is present) and alter your input methods accordingly. - it was my plan "B". I expected that phaser auto-detects the device and adjusts the input-touch. >>via the game.device.touch property - Potentially check can be defined using game.device.desktop Link to comment Share on other sites More sharing options...
Recommended Posts