Jump to content

how to use atlas for a tilemap


nak3ddogs
 Share

Recommended Posts

  • 1 year later...
  • 1 year later...
  • 2 weeks later...

I did this.. if this is what you are looking for

function preload() {
    game.load.atlas('terrain', 'resources/images/terrain/terrain.png', 'resources/images/terrain/terrain.json', Phaser.Loader.TEXTURE_ATLAS_JSON_HASH);

    game.load.tilemap('staticMap', 'resources/map/map.json', null, Phaser.Tilemap.TILED_JSON);
}

function create() {
    // Create map
    map = game.add.tilemap('staticMap');
    map.addTilesetImage('terrain', 'terrain');

    // Create layers
    grass = map.createLayer('Grass');
    stones = map.createLayer('Stones');
}

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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