MishaShapo Posted November 21, 2015 Share Posted November 21, 2015 I want to write a task-runner script that will take all of my assets in my asset folder and create a js file with the appropriate this.load commands. Does anyone have a list of all the file types (images, sounds, spreadsheets, etc) that Phaser supports? Thank you. =) Link to comment Share on other sites More sharing options...
cupcoffee Posted November 21, 2015 Share Posted November 21, 2015 There's not that many file types because (I might be wrong here) there's not that much types of assets you would normally use in a project. According to this documentation page http://phaser.io/docs/2.4.4/Phaser.Loader.html you can load the following asset types: Atlast(JSONArray, JSONHash, XML), Audio, AudioSprite(Sound, JSON), BitmapFont, Image, JSON, Pack(List of files to be loaded in JSON), Physics, Script, Shader, Spritesheet, Text, Tilemap, Video and XML. Now this is ALOT and i'm fairly certain you're not going to use every possible file extension in your project. However i can see where you're coming from.I am guessing you want to manage your asset loading by detecting and loading every asset in your folder. I do think this is possible using gulp but i think it would be a better approach(IMO) to use the Pack(List of files to be loaded in JSON) method and deliver this JSON using php's glob function. The same method is described in this topic: http://www.html5gamedevs.com/topic/12058-load-all-images-from-a-folder/ I hope this helps you to solve your assetloading problem drhayes 1 Link to comment Share on other sites More sharing options...
MishaShapo Posted November 24, 2015 Author Share Posted November 24, 2015 I did notice the pack loading option after already finishing my project. I might look into it later. For now, here is the finished gulp script. Easy and fast. =D Enjoy: https://www.npmjs.com/package/phaser-asset-loader#quick-start-guide cupcoffee 1 Link to comment Share on other sites More sharing options...
Recommended Posts