Mado Posted April 7, 2020 Share Posted April 7, 2020 Hi, I'm trying to load a Json form another Json loaded in the loader but don't know how to do. loader .add("map", "../../assets/map/map.json") .load(setup); It is a Tiled .json and inside there is the path to the "tileset.json", it looks like this : "tilesets":[ { "firstgid":1, "source":"..\/tiled\/tileset.json" }], "tilewidth":32, How to access this "tileset.json", how can I add it to the loader ? Knowing that I don't want to have to put it manually, I want the loader to find the json path inside map.json and load it. Thanks. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted April 8, 2020 Share Posted April 8, 2020 resource-loader, separated from pixijs: https://github.com/englercj/resource-loader/tree/release/3.x Make a loader middleware. I dont remember links to articles about it, but most people just deduce it from common pixi loaders: SpriteSheetLoader: https://github.com/pixijs/pixi.js/blob/dev/packages/spritesheet/src/SpritesheetLoader.ts , downloads extra png file and waits for it BitmapFontLoader: https://github.com/pixijs/pixi.js/blob/dev/packages/text-bitmap/src/BitmapFontLoader.ts , also loads extra files In plugins: spine loader: loads extra atlas file + png: https://github.com/pixijs/pixi-spine/blob/master/src/loaders.ts pixi-tiled : https://github.com/eXponenta/pixi-tiled/tree/master/src , find loader inside, look how it works. Quote Link to comment Share on other sites More sharing options...
Mado Posted April 9, 2020 Author Share Posted April 9, 2020 (edited) Ok thx, will try the spritesheet loader thing, seems the more easy to understand, will post the solution if I find it. Edited April 9, 2020 by Mado ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.