• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

HTML5 Setting up HTML5 player touch controls on smartphones.

Newbie here. I have a little HTML5 game running on my iPhone. I have on-screen controls to move the player and it actually works! The only problem I have is if I touch the player controls too hard or too long, the iPhone selects the whole game area and the copy/paste dialog pops up. I'm using the left mouse-down event to pickup the controls tap.
 

rIKmAN

Member
Newbie here. I have a little HTML5 game running on my iPhone. I have on-screen controls to move the player and it actually works! The only problem I have is if I touch the player controls too hard or too long, the iPhone selects the whole game area and the copy/paste dialog pops up. I'm using the left mouse-down event to pickup the controls tap.
This isn't a GMS2 issue, it's an OS level "feature" of the browser functionality and has been asked before on here. (Search is found at the top right of the forum or you can do it via Google).

Check this thread for some CSS you can add that should disable it on at least a couple of browsers and see if that helps.
 
S

Sam (Deleted User)

Guest
This isn't a GMS2 issue, it's an OS level "feature" of the browser functionality and has been asked before on here. (Search is found at the top right of the forum or you can do it via Google).

Check this thread for some CSS you can add that should disable it on at least a couple of browsers and see if that helps.
I'd still call it a GMS problem, personally. If it can be corrected with extra CSS, gms should be doing it on its own.
 

rIKmAN

Member
I'd still call it a GMS problem, personally. If it can be corrected with extra CSS, gms should be doing it on its own.
I meant that it's not a problem specific to GMS and would also happen with other non-GMS games.
It happens because when playing browser games on a mobile device that's the way the OS/browser handles the "long press" touch input.

Fair point that they could add the CSS to the exported project, but based on that post I linked it only works for a couple of browsers and there might also be people who want the functionality for whatever reason, so either way someone gets upset.

Easier to let any end user who wants it disabled to spend a minute adding in the CSS code to fix it for the couple of browsers it works for, but if there was a catch-all 100% working solution for every browser then I'd agree with you that they should add it - and they likely would.

Maybe adding the CSS (or a YYG approved solution) to the docs would be a good idea to save having to scour the internet for the information.
 
This isn't a GMS2 issue, it's an OS level "feature" of the browser functionality and has been asked before on here. (Search is found at the top right of the forum or you can do it via Google).

Check this thread for some CSS you can add that should disable it on at least a couple of browsers and see if that helps.
Thanks for the info. Really appreciate it. I’ll use search first next time too.
 
Top