Jump to content

Avoid scrolling on mobile devices


Recommended Posts


I have this Phaser 3 game inside a website. It fits a div container.

At some point, you can write on a HTML input to save your score. After the mobile keyboard pops up, the canvas scrolls up and everything starts to fail. The sprites coordinates stay fixed, but the canvas keeps the scroll, even when the keyboard is already closed.

I think the solution may be related with the Scale Manager, but I can't figure out what.

This is my configuration. Thanks!

this.config = {
            version: '0.0.1',
            type: Phaser.AUTO,
            parent: 'phaserContainer',
            width: data.baseWidth,
            height: data.baseHeigth,
            scale: {
                mode: Phaser.Scale.RESIZE,
                autoCenter: Phaser.Scale.CENTER_HORIZONTALLY
            backgroundColor: '#000000',
            banner: {
                hidePhaser: false,
                text: '#fff00f'
            physics: {
                default: 'arcade'
            scene: [
Link to comment
Share on other sites


  • Recently Browsing   0 members

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