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

 Share

  • Recently Browsing   0 members

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