Skip to content

Commit ad444d7

Browse files
authored
Merge pull request #433 from YoYoGames/gmb-4705-fix-stutter-on-touch-mobile
Fixes stutter on mobile browser games
2 parents 3a89301 + a048cc4 commit ad444d7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/_GameMaker.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,13 @@ function GameMaker_Init()
787787
canvas.addEventListener("click", function (e) {
788788
window.focus();
789789
});
790+
791+
/* ...this helps with eliminating stutter on mobile */
792+
document.addEventListener('touchstart', e => {
793+
e.preventDefault();
794+
}, {
795+
passive: false
796+
});
790797

791798
g_FrameStartTime = Date.now();
792799
window.requestAnimFrame(animate);

0 commit comments

Comments
 (0)