eddieone Posted December 4, 2015 Share Posted December 4, 2015 Hi, I'm testing the responsive template and when I increase the browser size it does not show more map. What's the right way to do this? I tried something like this with no luck.$( window ).resize(function() { self.layer.resizeWorld();}); Link to comment Share on other sites More sharing options...
jmp909 Posted December 4, 2015 Share Posted December 4, 2015 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 expensivehttp://phaser.io/docs/2.4.4/Phaser.TilemapLayer.html#resize there's an example herehttp://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 More sharing options...
eddieone Posted December 6, 2015 Author Share Posted December 6, 2015 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 arevar 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 More sharing options...
Recommended Posts