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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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