PhaserEditor2D-v3
PhaserEditor2D-v3 copied to clipboard
Images don't load if there is an audio key with the same key as the sprite
Version
- Phaser Editor 2D Version: 3.33.2
- Operating System: Windows 11
- Web Browser and version: Google Chrome 103.0.5060.114
Description
I have an audio in the pack of my scene with the same key as the spritesheet. When I change the key, the images load normally again.
In Phaser, both the images and the audio load, so I assume it shouldn't be a problem to use the same key since they are two different types.
So I assume it's a problem with Phaser Editor?
Yes you should use different keys.
But why? In Phaser you can use the same keys.
It is different in Phaser Editor. We use a custom cache for storing the images.
This is something I can fix but may introduce bugs. I don't know if the issue worths the effort and risk.
Is it mandatory for you to share the same keys? I would like to know more the problem.
I have several scenes that have background music, and for this background music I would like to use the same key as for the sprite.
If this could really cause problems, an alternative for me would be to just set the scene key as a prefix in the background music key, like sceneName/background
. Even though I would rather use the scene key.
Yes it is a bit problematic to change it. It may introduce bugs.
But please, can you explain me a bit why are you organizing the assets in that way? I need to understand the big picture here.
I have several rooms in my game that all have a sprite and background music. The sprite has the same key as the scene of the room, so I find it most useful if the audio also has the same key.
Wouldn't it be enough to use the type as a prefix in the caching? Like for example sprite/myspritename
or audio/mybackground
. Or is it more complicated than that?
Hi. You find it more useful if the audio also has the same key, but why? I can change the editor for allowing repeated keys, but it may introduce bugs. Maybe you can use a prefix in your audio keys in the meantime.
I think it would be more consistent. You could use the same key for sprite and audio instead of different ones.
And since Phaser uses keys per type, I think it makes the most sense for Phaser Editor to do the same.
I was really surprised when the images stopped loading in Phaser Editor, since it worked in Phaser.