Jump to content

What file types does Phaser support? (for a Gulp script)


MishaShapo
 Share

Recommended Posts

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

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 :)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...