Jump to content

Import TileMap with collection of images


Fairydhwen
 Share

Recommended Posts

Hey,

Does Phaser can import collection of images (not tileset) for a tilemap from Tiled?

Only function i found is :

game.load.image(tileName, tileSetFile); // here i need to load all my images (which are not in a tileset)

then

map.addTilesetImage(inTiledTileSetName, tileName);  

from my JSON tilemap :

 "tilesets":[
        {
         "columns":0,
         "firstgid":1,
         "margin":0,
         "name":"Sol",
         "spacing":0,
         "tilecount":5,
         "tileheight":128,
         "tiles":
            {
             "0":
                {
                 "image":"PNG\/Environment\/dirt.png"
                },
             "1":
                {
                 "image":"PNG\/Environment\/grass.png"
                },
             "2":
                {
                 "image":"PNG\/Environment\/sand.png"
                },
             "3":
                {
                 "image":"PNG\/Environment\/treeLarge.png"
                },
             "4":
                {
                 "image":"PNG\/Environment\/treeSmall.png"
                }
            },
         "tilewidth":128
        }, 

Regards

Link to comment
Share on other sites

Phasers documentation says;

Quote

A single map may use multiple tilesets. Note that the tileset name can be found in the JSON file exported from Tiled, or in the Tiled editor.

So you could load each image individually then call;

map.addTilesetImage();

For each of your tilesets 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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