Sign in to follow this  
elleniaw

StaticTilemap shrinks tiles

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

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.