Jump to content

Phaser 3 Sizes all wrong on High DPI screen


ZipBob
 Share

Recommended Posts

Hi, Phaser newbie here. So I was trying to make a very basic Phaser game where there are sprites falling from the sky and the play attempts to catch them. However, I've run into a problem regarding sizes and coordinates. My game is 240px by 480px. I have a image which is 24x24 px. I want to load this image and scale it to fit the game's width and height. Which means a scaleX of 10 and scaleY of 20. But, when I do this, it only covers one half of the width and height of the canvas being displayed. (See screenshot below.) I suspect this is something to do with my high DPI screen. But window.devicePixelRatio is 1.5 (not 2 as would be expected from this behaviour). Am I doing something wrong? Please help since I couldn't find anything similar after searching Google.

 

image.thumb.png.e1abee783737d1a7b892a2dafbe5cdd3.png

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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