Ytyse Posted August 8, 2016 Share Posted August 8, 2016 Hi everyone, I'm trying to make a platformer who can run on any smartphone. I have a tilemap with theses features : - 40 Tiles heights -100 Tiles widths - Each tiles is 64x64px. To calculate my scale I simply use that as reference : var SCALE = window.innerHeight/ 2560; //64*40 = 2560px, the height of my tilemap I already made a platformer with 16x16px tiles and every scale worked very well, so i just copy paste that simple code : map = that.game.add.tilemap('objects'); map.addTilesetImage('items', 'tiles'); map.setCollisionBetween(0, 16); that.game.scale.scaleMode = Phaser.ScaleManager.RESIZE; layer = map.createLayer('mario_niveau_1'); layer.debug = true; layer.setScale(SCALE,SCALE); layer.resizeWorld(); That's work when my SCALE is better than 1 but not when it's less. My collision are always good, but the map don't show up like you can see below Any ideas ? bdekk 1 Link to comment Share on other sites More sharing options...
Ytyse Posted August 10, 2016 Author Share Posted August 10, 2016 It should help : layer.resize(width,height); Link to comment Share on other sites More sharing options...
Ytyse Posted August 10, 2016 Author Share Posted August 10, 2016 Thanks bro ! Link to comment Share on other sites More sharing options...
Recommended Posts