Sign in to follow this  
Liranan

Avoid scrolling on mobile devices

Recommended Posts

Hi!

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: [
                Bootloader,
                Play,
                UI,
                Leaderboard
            ]
        };

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.