Jump to content

Tilemap not resized using responsive template


eddieone
 Share

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

http://phaser.io/docs/2.4.4/Phaser.TilemapLayer.html#resize

 

there's an example here

http://phaser.io/examples/v2/tilemaps/resize-map

 

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.
https://gamedevacademy.org/html5-phaser-tutorial-top-down-games-with-tiled/

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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