Sign in to follow this  
Fairydhwen

Import TileMap with collection of images

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

Share this post


Link to post
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 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.