PhaserEditor2D / PhaserEditor

A friendly IDE to develop HTML5 games based on the Phaser framework.
https://phasereditor2d.com
Eclipse Public License 1.0
330 stars 45 forks source link

Asset pack editor: adding image issues #82

Closed PhaserEditor2D closed 5 years ago

PhaserEditor2D commented 6 years ago

Issue reported by a user in facebook:

Hi I’m using Phaser Editor 1.5.1 Thanks for making good tool 🙂

I have some requests for Assets

when I add “image” in Asses in Phaser Editor, “key” name which is added is not include URL path.

is there any solution to add “URL path” to image “key” automatically?

I will attach the image.

thanks!

assets image

PhaserEditor2D commented 6 years ago

Hi,

Thanks for making good tool slightly_smiling_face

You are welcome!

when I add “image” in Asses in Phaser Editor, “key” name which is added is not include URL path.

I do not understand very well your request. When you add an image, by default it set as key the name of the image, without the extension. Like you show in the screenshot, for assets/images/golem_image/right.png it uses the key right, but you are free to change that name. If you are using the scene editor, we recommend to rename it by pressing F2, it will show the refactoring dialog so scene files will be updated with the new name.

For the moment there is not a way to change this behavior, you have to manually change the key of the image.

For example, here there is the image logo.png. I want to change its key to images/logo.png so I select the image and press F2. The Rename refactoring dialog is open, so I write the new key images/logo.png and press Continue:

image

The dialog shows the scene files that will be updated, press Continue:

image

...and the key is updated, in the pack file and the scenes files:

image

Does it answer your question? Am I missing something?

dirablue commented 6 years ago

Hi, Thank you. I understand I have to change a key manually for now. I hope new editor version will support the function like this. ( if there is a lot of files, a bit tough to change name each file )

PhaserEditor2D commented 6 years ago

Yes, maybe we can provide an option to include the parent folder in the image (and another type of assets) key.

I will think about it. I keep this as a feature request.

PhaserEditor2D commented 6 years ago

Actually, that option could be included in the Texture Packer too, so you can pack the images in an atlas and use the parent folder name as the prefix.

dirablue commented 6 years ago

Hi, ok thanks. I will use texture atlas for images.

I was using image files instead of texture atlas during development, but I think I should use atlas format for it. I feel this is not a necessary function for the editor.

thanks!

PhaserEditor2D commented 6 years ago

I will think if I keep this option in the Asset Pack editor, but I created a new issue (#85) to include this option (parent folder name as the prefix) in the Atlas Generator editor.

dirablue commented 6 years ago

thank you for your support! :)