Jump to content

Using an Atlas with Tilemap


c-andrews
 Share

Recommended Posts

Hi,

 

I've just started using Phaser and its great. Theres lots of tutorials and lots of answered questions. But now i've hit a bit of a wall.

 

I would like to try and use an Atlas with a TileMap (built using Tiled) and cant seem to find any information on it. I am using an atlas because my graphical assets are all different sizes, well apart from the floor tiles. 

 

Here some code:

preload : function () {	this.load.tilemap( "level", "assets/tilemaps/level.json", null, Phaser.Tilemap.TILED_JSON );	this.load.atlas( "scenery", "assets/sprites/scenery.png", "assets/sprites/scenery.json" );}create : function() {		this._map = this.game.add.tilemap( 'level' );		//this._map.addTilesetImage( 'ground', 'ground-tiles' );	this._backgroundLayer = this._map.createLayer( "ground" );	this._backgroundLayer.resizeWorld();} 

This is just using one image with the key "ground-tiles". But now my map need collidables and trees etc.

 

Can anyone tell me how or if i can use an Atlas with my Tilemap?

 

Thanks

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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