Jump to content

Tilemap Scaling, needs help(with screenshots :D )


Ytyse
 Share

Recommended Posts

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 :

grand.PNG

And when I test it with mobile dimension, it looks like that :

petit.PNG
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...

crop.PNG


In addition, How can I scale my objects layer for my collision ?

Tiled view of my layer :

colision.PNG

Any ideas ?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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