3.3 KiB
3.3 KiB
Phaser 3.60.0 Change Log
Return to the Change Log index.
Loader New Features
- You can now set
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) - You can now use dot notation as the datakey when defining a Loader Pack File (thanks @rexrainbow)
Loader Updates
MultiFile.pendingDestroyis a new method that is called by the Loader Plugin and manages preparing the file for deletion. It also emits theFILE_COMPLETEandFILE_KEY_COMPLETEevents, fixing a bug whereMultiFilerelated files, such as an Atlas JSON or a Bitmap Font File, wouldn't emit thefilecompleteevents for the parent file, only for the sub-files. This means you can now listen for the file completion event formultiatlasfiles, among others.MultiFile.destroyis a new method that clears down all external references of the file, helping free-up resources.File.addToCacheno longer callsFile.pendingDestroy, instead this is now handled by the Loader Plugin.- There is a new File constant
FILE_PENDING_DESTROYwhich is used to ensure Files aren't flagged for destruction more than once. LoaderPlugin.localSchemesis a new array of scheme strings that the Loader considers as being local files. This is populated by the newPhaser.Core.Config#loaderLocalSchemegame / scene config property. It defaults to[ 'file://', 'capacitor://' ]but additional schemes can be defined or pushed onto this array. Based on #6010 (thanks @kglogocki)- A new
console.errorwill be printed if theFile,MultiFile,JSONFileorXMLFilefail to process or parse correctly, even if they manage to load. Fix #5862 #5851 (thanks @samme @ubershmekel) - The
ScriptFileLoader 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.
Loader Bug Fixes
- When
ImageFileloads 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) - Using a
dataKeyto specify a part of a JSON file when usingload.packwould 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) - The URL scheme
capacitor://has been added to the protocol check to prevent malformed double-urls in some environments (thanks @consolenaut) - Loading a Script File Type will now default the 'type' property to 'script' when a type is not provided. Fix #5994 (thanks @samme @ItsGravix)
Return to the Change Log index.
📖 Read the Phaser 3 API Docs 💻 Browse 2000+ Code Examples 🤝 Join the awesome Phaser Discord