Mobile performance different between "present" and "full screen"

I made a checkers game in p5 and it is working well, but I noticed a really strange behavior when using the share links. When I use “full screen” in my mobile (or mobile emulation with inspect mode in chrome) I get the normal behavior and everything works smoothly. However, when I use the “present” mode, the selection of the pieces is much more sluggish.

Full Screen mode:

Present mode:

Any Idea why this would be? My only guess is that there is something wrong with the way I coded the touch selection, but I can’t seem to see what.

1 Like

Same thing happens with another project.

Full (all ok):

Present (very slow):

Is this normal? Seems super strange to me to be honest.

I can’t replicate this in my (old) laptop with an up-to-date Chrome browser – when I interact at the two links above, both seem equally snappy. Can you add timing debug information? Something device-specific, maybe to Android?

I think I figured out the issue.
It seems to be related to resolution. Basically the source-code of “full” sets a viewport but “present” doesn’t. To fix this I added:

<meta name="viewport" content="width=device-width, initial-scale=1.0">

just below the <head>

Without this it seems p5 ignores the pixel density and renders for the full screen resolution.

1 Like