Jump to content

Scaling and input fields

Recommended Posts

In my game I have a form that I built with Orange Games' input plugin (https://github.com/orange-games/phaser-input). The input form working great on computer, but on mobile when you tap into an input field, it zooms in, and becomes impossible to see what you're doing, or go to the next field.

I tried using scale prevention with meta tags:

<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">


<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=2, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />

but my game uses "game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL" to look good on all resolutions. So when I put in the meta tags, it doesn't scale initially, and it is too big on mobile. 

Is there any way to use a meta tag that allows for initial scaling on mobile, but then freezes the scale in order to prevent zooming on input fields?

Link to post
Share on other sites
  • 4 months later...

in my case it worked like this:

  • in html i do this :

<meta name="viewport" content="user-scalable=no,  initial-scale=1,  maximum-scale=1,  width=device-width" />

  • in css, this:

           * {
            padding: 0;
            margin: 0;

  • and in phaser i do this 

game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;

        game.scale.pageAlignHorizontally = true;
        game.scale.pageAlignVertically = true;

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.

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.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...