Jump to content

StaticTilemap shrinks tiles


elleniaw
 Share

Recommended Posts

I'm not sure if this is a bug or expected behaviour:

this.load.spritesheet('level_tm', 'level_tm.png',{ frameWidth: 32, frameHeight: 32 });
this.map = game.make.tilemap({ key: 'map' });
let groundTiles = this.map.addTilesetImage('level_tm');
this.groundLayer = this.map.createStaticLayer('Ground Layer', groundTiles, 0, 0);

This creates a layout of the tilemap where the tiles are really small. 

Note that If I replace createStaticLayer with createDynamicLayer the result is as expected. 

Did I forget to specify the tileWidth and tileHeight somewhere? If so, why does it work for "createDynamicLayer"

 

Static.png

Dynamic.png

Link to comment
Share on other sites

I found a way to make it work:

//changing

this.load.spritesheet('level_tm', 'level_tm.png',{ frameWidth: 32, frameHeight: 32 });

//into 

this.load.image('level_tm', 'level_tm.png');

Fixed it. Though I still expect the first to also work (because for DynamicLayer it works fine - and I don't see why the first would be invalid)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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