Jump to content

Vertical Align trouble


Yanifska
 Share

Recommended Posts

Hi,
 
I am using:
this.scale.pageAlignHorizontally = true;this.scale.pageAlignVertically = true;

and the game is aligned horizontally but not vertically.

I think the div is exactly the height of the game so it doesn't leave any room to place the game.

 

Ia m not sure what part of the code I shall reveal so you people can help me, but basically I am using the mobile template.

 

this is  my index file:

var gameWidth =  Math.max(window.innerWidth, window.innerHeight) * window.devicePixelRatio;var gameHeight = Math.min(window.innerWidth, window.innerHeight) * window.devicePixelRatio;var ratio = gameHeight / 640;gameWidth /= ratio;gameHeight /= ratio;var game = new Phaser.Game(gameWidth, gameHeight, Phaser.CANVAS, 'game');

and my boot file:

 this.input.maxPointers = 1; this.stage.disableVisibilityChange = true;        if (this.game.device.desktop)        {            this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL ;            this.scale.setMinMax(480, 260, 720, 480);            this.scale.setUserScale(0.8, 0.8)            this.scale.pageAlignHorizontally = true;            this.scale.pageAlignVertically = true;        }

i didn't touch the css file from the template

 

Any one got an idea how I can get the game in the center of the screen ?

 

thank you in advance

Yaniv

 

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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