Skip to content

Commit a048cc4

Browse files
This fixes stutter on mobile browser games
Closes: YoYoGames/GameMaker-Bugs#4705
1 parent 3a89301 commit a048cc4

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)