Jump to content

Note5 or Galaxy S6 has devicePixelRatio of 4


fkkcloud
 Share

Recommended Posts

configuration.canvas_width = window.screen.availWidth * window.devicePixelRatio;
configuration.canvas_height = window.screen.availHeight * window.devicePixelRatio;
configuration.aspect_ratio = configuration.canvas_width / configuration.canvas_height;
if (configuration.aspect_ratio < 1) configuration.scale_ratio = configuration.canvas_height / configuration.canvas_height_max;
else configuration.scale_ratio = configuration.canvas_width / configuration.canvas_width_max;

game = new Phaser.Game(configuration.canvas_width, configuration.canvas_height, Phaser.CANVAS, 'gamewindow');

game.scale.fullScreenScaleMode = Phaser.ScaleManager.SHOW_ALL;
game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
game.scale.refresh();

loadImage = this.add.image(this.world.centerX, this.world.centerY, 'loadsplash');
loadImage.anchor.set(0.5);
loadImage.scale.set(configuration.scale_ratio);

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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