Jump to content

Tilemap not resized using responsive template


Recommended Posts

are you trying to reveal more of the map but keep it at the same scale? you said "it does not show more map" so i assume so.


you can use resize() i think but it says not to bind it to window resize event as it is expensive



there's an example here



resizeWorld makes the world the same size as the map, otherwise you'd only end up seeing eg one screen size of the map and it wouldn't scroll.

Link to comment
Share on other sites

Hi, thanks for sharing. I missed that example.


I found mostly what I was after from the demo files in the following tutorial.

The main parts are

var game = new Phaser.Game(1248, 720, Phaser.CANVAS, '');this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;this.scale.pageAlignHorizontally = true;this.scale.pageAlignVertically = true;

This let me set the same amount of tiles even for different resolutions. It mostly fills the screen but maintains aspect ratio.


I do still wonder, if it's possible to keep what I have and fill the screen horizonally with tiles?

Link to comment
Share on other sites


  • Recently Browsing   0 members

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