Jump to content

[solved] How to get Touch Input on Buttons to work


valueerror
 Share

Recommended Posts

As you can see here : http://test.xapient.net/phaser/touch.html

i managed to make a virtual gamecontroller with gamecontroller.js (source: https://github.com/austinhallock/html5-virtual-game-controller )

the problem with this is.. its horribly slow.. the joystick is the slowest so i use the dpad but for some reason the whole game get's even slower on every restart (if you die for example and respawn - game is a 3rd slower - die again - game slows down again)

furthermore it seems like an unwanted overload if you can implement nice buttons with phaser quckly.. so i made these:

http://test.xapient.net/phaser/

unfortunately you can click on them with a mouse.. but no touch them.. :(

i do not want to set a function that is triggered on touch because for my purpose i have to ask for the state.. i need something like

pseudo:

if (buttonLeft.isDown) { left = true; } else { left = false;} if (buttonRight.isDown) { right = true; } else { right = false;}
i read through other posts and the docs for hours but i can't figure it out.. so help would be very much appreciated :)

thx!

Link to comment
Share on other sites

hmm... i thought this would be an easy one..  :(  

 

isn't there a way to find out if a button is over, down or nothing? there should be since you can define different frames for the different states of a button.. guess i have to read more source and do more trial and error..

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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