changelog/v3/3.60/Loader.md
Return to the Change Log index.
loader.imageLoadType: "HTMLImageElement" in your Game Configuration and the Phaser Loader will use an Image Tag to load all images, rather than XHR and a Blob object which is the default. This is a global setting, so all file types that use images, such as Atlas or Spritesheet, will be changed via this flag (thanks @hanzooo)MultiFile.pendingDestroy is a new method that is called by the Loader Plugin and manages preparing the file for deletion. It also emits the FILE_COMPLETE and FILE_KEY_COMPLETE events, fixing a bug where MultiFile related files, such as an Atlas JSON or a Bitmap Font File, wouldn't emit the filecomplete events for the parent file, only for the sub-files. This means you can now listen for the file completion event for multiatlas files, among others.MultiFile.destroy is a new method that clears down all external references of the file, helping free-up resources.File.addToCache no longer calls File.pendingDestroy, instead this is now handled by the Loader Plugin.FILE_PENDING_DESTROY which is used to ensure Files aren't flagged for destruction more than once.LoaderPlugin.localSchemes is a new array of scheme strings that the Loader considers as being local files. This is populated by the new Phaser.Core.Config#loaderLocalScheme game / scene config property. It defaults to [ 'file://', 'capacitor://' ] but additional schemes can be defined or pushed onto this array. Based on #6010 (thanks @kglogocki)console.error will be printed if the File, MultiFile, JSONFile or XMLFile fail to process or parse correctly, even if they manage to load. Fix #5862 #5851 (thanks @samme @ubershmekel)ScriptFile Loader File Type has a new optional parameter: type. This is a string that controls the type attribute of the <script> tag that is generated by the Loader. By default it is 'script', but you can change it to 'module' or any other valid type.ImageFile loads with a linked Normal Map and the map completes first, but the Image is still in a pending state, it would incorrectly add itself to the cache instead of waiting. It now checks this process more carefully. Fix #5886 (thanks @inmylo)dataKey to specify a part of a JSON file when using load.pack would fail as it wouldn't correctly assign the right part of the pack file to the Loader. You can now use this parameter properly. Fix #6001 (thanks @rexrainbow)capacitor:// has been added to the protocol check to prevent malformed double-urls in some environments (thanks @consolenaut)Return to the Change Log index.
š Read the Phaser 3 API Docs š» Browse 2000+ Code Examples š¤ Join the awesome Phaser Discord