question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to set defaultType on pack files as well as override type on a specific file

See original GitHub issue

In 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:closed
  • Created a year ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
PhaserEditor2Dcommented, Oct 13, 2022

I think we can close this issue. If there is any issue with the rive plugin, we can open a new issue.

0reactions
PhaserEditor2Dcommented, Sep 23, 2022

Yes, also you can configure it via a flag -plugins, in the phasereditor2d.config.json: https://help-v3.phasereditor2d.com/misc/plugins.html#project-s-plugins

Read more comments on GitHub >

github_iconTop Results From Across the Web

Overriding interface property type defined in Typescript d.ts file
I use a method that first filters the fields and then combines them. reference Exclude property from type interface A { x: string...
Read more >
Include File Patching Facilities - Sitecore Documentation
Include files allow you to introduce new settings, properties, and configuration nodes, as well as override the values of existing settings, properties and ......
Read more >
Overview: IBM i overrides
An override is a CL command that temporarily changes a file name, a device name, or remote location name associated with the file,...
Read more >
Java Generated Code | Protocol Buffers - Google Developers
You can specify multiple .proto files in a single invocation; all output files will be generated at once. When outputting Java code, the...
Read more >
Modules: Packages | Node.js v19.3.0 Documentation
mjs files are treated as ES modules within a "module" package). Within a "type": "commonjs" package, Node.js can be instructed to interpret a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found