Jump to content

how to scale game to fit browser window in Phaser 2.x ?


davidv8
 Share

Recommended Posts

Have you looked at ScaleManager? It is accessed through the game's scale object.

 

This thread also covers different ways people are using it.

game.stage.scaleMode = Phaser.StageScaleMode.SHOW_ALL;game.stage.scale.setShowAll();game.stage.scale.refresh();

There is also an alternative, although not recommended, way of using CSS to force the browser to use its full, available dimensions.

canvas {    position: absolute;    top: 0px;    left: 0px;    width: 100%;    height: 100%;}
Link to comment
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...
 Share

  • Recently Browsing   0 members

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