Ability to set defaultType on pack files as well as override type on a specific file
See original GitHub issueIn order to more fully leverage the built in loading system of Phaser, it would be convenient if Phaser Editor allowed you to specify the defaultType for a json pack file (https://github.com/photonstorm/phaser/blob/master/src/loader/LoaderPlugin.js#L650) as well as override the type property for a particular file.
The reason is that if you want to load assets via a pack file that are not built-in Phaser assets, you have to load the pack file via a new pack loader plugin. In the new pack loader plugin you have to process the pack json and create instances of the particular file type that you want. This is due to the fact that the built in pack loader tries to look up the file’s type after the pack file is processed and won’t be able to find the new type.
To clarify with an example, in this case we want to load Rive animations (rive.app), but when they are added to a pack file they get set with a generic type of bin.  This means that while the file gets loaded, it won’t be processed until after the preload phase since there is no generic bin type that would do the processing during the load phase (https://github.com/photonstorm/phaser/blob/master/src/loader/LoaderPlugin.js#L665).
By allowing the defaultType and type to be overridden, we could either place all rive animations in a single pack file and specify the defaultType to rive or place the rive animations in the main pack file and just set the type property to be rive instead of bin.  And we would just need to create a simple RiveFile class that extends Phaser.Loader.File.
Issue Analytics
- State:
 - Created a year ago
 - Comments:14 (7 by maintainers)
 

Top Related StackOverflow Question
I think we can close this issue. If there is any issue with the rive plugin, we can open a new issue.
Yes, also you can configure it via a flag
-plugins, in thephasereditor2d.config.json: https://help-v3.phasereditor2d.com/misc/plugins.html#project-s-plugins