Ytyse Posted August 30, 2016 Share Posted August 30, 2016 Hello guys, I'm making a plaformer, and I use the tiledmap plugin (https://github.com/englercj/phaser-tiled) to have best performance on mobile(and it works). There's always a black space below my tilemap : And when I test it with mobile dimension, it looks like that : I wish I could fill my canvas full height with my tilemap with any device, without "y-axe scrolling" or black space. When I try to scale my layer : var winW = window.innerWidth; var winH = window.innerHeight; var height_of_game_in_pixels= 1536; //24tiles*64px var SCALE = winH / height_of_game_in_pixels; map = game.add.tiledmap('mario_niveau_1'); that.game.physics.p2.convertTiledCollisionObjects(map, 'essai1'); layer = map.layers[0]; layer.scale.setTo(SCALE,SCALE); layer.resizeWorld(); It's cropping like that... In addition, How can I scale my objects layer for my collision ? Tiled view of my layer : Any ideas ? Link to comment Share on other sites More sharing options...
marlene Posted September 6, 2016 Share Posted September 6, 2016 Have you tried setting the scale mode as the default scale mode is 'NO_SCALE'. For example: init: function () { this.scale.scaleMode = Phaser.ScaleManager.EXACT_FIT; this.scale.pageAlignVertically = true; this.scale.pageAlignHorizontally = true; } Link to comment Share on other sites More sharing options...
Recommended Posts