Jump to content

CreateFromObjects Displaying Entire Tileset


Binguu
 Share

Recommended Posts

function preload() {

	this.load.tilemap('map', 'public/maps/thegamemap.json', null, Phaser.Tilemap.TILED_JSON);

	this.load.image('tiles', 'public/images/basictiles.png');
}

function create() {

	...

	this.map.createFromObjects('Ore', 64, 'tiles', 0, true, false, this.ore_group);

	...

}

7VLxixA.png

 

The above code is showing the entire tileset. The gid is correct, but I have a feeling the fourth parameter may be the issue? Please let me know if you need anymore information, any help would be appreciated.

Link to comment
Share on other sites

 

48 minutes ago, samme said:

You need to add something like 


this.load.spritesheet('tiles_spritesheet', 'public/images/basictiles.png', /*…*/);

and then use that spritesheet key.

That makes all too much sense. Completely fixed the issue, thank you very much!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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