alflashy Posted March 24, 2018 Share Posted March 24, 2018 Hi, I want to load multiple images which currently I am loading individually from JSON with for loop in Preload and Create function like this below. Its loading about 20/25 images and I want to know whats the best way to load these images. I looked in sprite sheet and atlasXML but looks like its more for Animation and not not for static images. http://examples.phaser.io/_site/view_lite.html?d=animation&f=multiple+anims.js&t=multiple Thank you Link to comment Share on other sites More sharing options...
onlycape Posted March 24, 2018 Share Posted March 24, 2018 Hi @alflashy, For better graphic performance and save http calls to the server, use a spritesheet is a good idea: // In your preload function game.load.atlasJSONArray('atlas_key','myAtlasImage.png','MyAtlasJsonFile.json'); // In your create function var Image1 = game.add.image(0,0,'atlas_key','frameName1'); var Image2 = game.add.image(50,50,'atlas_key','frameName2'); /* ....................... */ To create the spritesheet I use: https://www.leshylabs.com/apps/sstool/ (select the "JSON-TP-Array" format) Regards. Link to comment Share on other sites More sharing options...
alflashy Posted March 25, 2018 Author Share Posted March 25, 2018 Thank you I'll try it Link to comment Share on other sites More sharing options...
alflashy Posted March 31, 2018 Author Share Posted March 31, 2018 Worked well thank you Link to comment Share on other sites More sharing options...
Recommended Posts