Jump to content

Zoom on Mobile + 300ms Tap Delay


TomFiveThumbs
 Share

Recommended Posts

Hi all,

 

I discovered the 300ms Delay on tap events when viewing my game through a mobile browser.

 

I added this meta tag: 

<meta name="viewport" content="width=device-width, user-scalable=no">

But now my game is zoomed in to a crazy level.

 

Here's what it looks like on my desktop browser:

 

79dorYg.jpg

 

 

And here's what it looks like on my mobile browser

 

wsCdfSw.png

 

 

 

Any idea on how to fix this up? It seems to take care of the 300ms delay... but as you can see, it poses another problem.

Link to comment
Share on other sites

Have you considered using touchstart event instead of click? There are downsides with this approach as this event can fire too often (usually can handle this with a healthy mix of throttle or debouncing depending on your use case), but in some cases this approach makes more sense than viewport mangling.


Source: https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent#touchstart

Link to comment
Share on other sites

What values did you give the scaleManager, i.e game.scale.maxWidth ?

 

I didn't! I changed the scaling, that cleared it up.

 

 

Have you considered using touchstart event instead of click? There are downsides with this approach as this event can fire too often (usually can handle this with a healthy mix of throttle or debouncing depending on your use case), but in some cases this approach makes more sense than viewport mangling.

Source: https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent#touchstart

 

That did it.

 

Thanks to both of you.

 

I now have a lagging issue still on a phoneGap app made from the code, but that's probably something else, so I'll mark this thread as solved. Thanks again!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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