Fairydhwen Posted May 17, 2016 Share Posted May 17, 2016 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 More sharing options...
drhayes Posted May 17, 2016 Share Posted May 17, 2016 No, Phaser will not load the images specified in your tilemap for you. You have to load them yourself and then, when creating the tilemap in Phaser, tell Phaser which images to use for which tiles. Link to comment Share on other sites More sharing options...
Fairydhwen Posted May 17, 2016 Author Share Posted May 17, 2016 but how do i load them ? my problem is i dont have one file (tileset.png) for all my images. (5 PNG like in my example for 1 tileset) Link to comment Share on other sites More sharing options...
Sawyer Posted May 17, 2016 Share Posted May 17, 2016 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 More sharing options...
Fairydhwen Posted May 18, 2016 Author Share Posted May 18, 2016 No, Phaser 2 dont support collection of images. https://github.com/photonstorm/phaser/issues/1339 Quote photonstorm : This feature request has been moved to the Phaser 3 feature list (so is being closed here) Only TileSet for V2. :'( Link to comment Share on other sites More sharing options...
drhayes Posted May 18, 2016 Share Posted May 18, 2016 Oh! I didn't notice, I thought they were separate tilesets. Sorry to mislead you! Link to comment Share on other sites More sharing options...
Recommended Posts