Last active
March 28, 2022 07:15
-
-
Save LiamPerson/1f9619160c5475e6de8b3baec5f38e43 to your computer and use it in GitHub Desktop.
All of the types that can be loaded with the loader plugin in Phaser 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* All the types that can be loaded with | |
* the loader plugin in Phaser 3 | |
* grouped by settings. | |
* | |
* Referencing https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html | |
*/ | |
switch(type.toUpperCase()) { | |
case "BINARY": // key url ... | |
case "CSS": | |
case "HTML": | |
case "SCRIPT": | |
case "SCENEFILE": | |
case "TEXT": | |
case "TILEMAPCSV": | |
case "TILEMAPIMPACT": | |
case "TILEMAPTILEDJSON": | |
case "XML": | |
break; | |
case "IMAGE": // key url normal_map ... | |
break; | |
case "SCRIPTS": // key url extension ... | |
break; | |
case "SPRITESHEET": // key url frameconfig ... | |
break; | |
case "SVG": // key url svgconfig ... | |
break; | |
case "AUDIO": // key url config ... | |
break; | |
case "ANIMATION": // key url datakey ... | |
case "JSON": | |
case "PACK": | |
break; | |
case "GLSL": // key url shaderType ... | |
break; | |
case "MULTIATLAS": // key atlasurl path baseurl ... | |
break; | |
case "OBJ": //key objurl maturl flipuv ... | |
break; | |
case "PLUGIN": // key url start mapping ... | |
break; | |
case "SCENEPLUGIN": // key url systemkey scenekey ... | |
break; | |
case "HTMLTEXTURE": // key url width height ... | |
break; | |
case "VIDEO": // key url loadevent asblob noaudio ... | |
break; | |
case "UNITYATLAS": // key textureurl atlasurl texturexhrsettings atlasxhrsettings | |
break; | |
case "ASEPRITE": // key textureurl atlasurl texturexhrsettings atlasxhrsettings | |
case "ATLAS": | |
case "ATLASXML": | |
break; | |
case "BITMAPFONT": // key textureurl fontdataurl texturexhrsettings fontdataxhrsettings | |
break; | |
case "AUDIOSPRITE": // key jsonurl audiourl audioconfig audioxhrsettings jsonxhrsettings | |
break; | |
case "SPINE": // key jsonurl atlasurl premultipliedalpha texturexhrsettings atlasxhrsettings | |
break; | |
default: | |
throw TypeError("Error in loading asset by type. Unknown type."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment