Loading the texture atlas
To get the texture atlas into Pixi, load it using Pixi’s loader
. If the JSON file was made with Texture Packer, the loader
will interpret the data and create a texture from each frame on the tileset automatically. Here’s how to use the loader
to load the treasureHunter.json
file. When it has loaded, the setup
function will run.
loader
.add("images/treasureHunter.json")
.load(setup);
Each image on the tileset is now an individual texture in Pixi’s cache. You can access each texture in the cache with the same name it had in Texture Packer (“blob.png”, “dungeon.png”, “explorer.png”, etc.).
当前内容版权归 kittykatattack 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 kittykatattack .