PhaserEditor2D / PhaserEditor

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

Do actions for multiple/all sprites at once #107

Closed Thaval closed 5 years ago

Thaval commented 5 years ago

Hi,

it would be nice to have the ability to make an action to multiple selected assets within the canvas editor, like setting a special scale.x oder tile.scale.y value for all selected assets. The reason could be: align multiple assets, for example I would not need to select each single asset of the same type and C&P the value or do it manually by Drag and drop. Another reason: Image your designer changes a lot of images (in accordance to their resolution) but the level resolution would remain the same. The only thinkg you can do is resizing the images by yourself and scale them down within phaser. I would go with the second option, but because there a like 500 images per canvas (and I have a bunch of canvas files).. this takes like forever. Is there an automated process I can take advantages of? I already thought about writing a simple script, but I'm too afraid I will forget some point and my complete app will throw errors as crazy.

Kind regards.

PhaserEditor2D commented 5 years ago

Hello @Thaval

Do you mean v1 right?

Well, that version of the editor has serious problems with the edition of multiple objects, we did a bad design of the properties editor at the beginning, and now it is very hard and error prone to change it. In the v2 of the editor, it is possible to do since day 0, we use a better design.

To change the .canvas files is not a crazy idea. Those are simple JSON files that are easy to understand. Just close all the Canvas editors and do the modifications, then re-open them.

Thaval commented 5 years ago

Do you mean v1 right?

Yea, I do.

the editor has serious problems with the edition of multiple objects, we did a bad design of the properties editor

I assume you have an event listener for the selected node in the properties editor, right? And there's another method that you call to perform the action (from the context menu) for that given node. Wouldn't it be possible to just hold a list of selected nodes and perform the action on all of them? Extending the method to work with multiple nodes.

To change the .canvas files is not a crazy idea. Those are simple JSON files that are easy to understand. Just close all the Canvas editors and do the modifications, then re-open them.

I did so. I just opened it up in Notepad and replaced some strings with regex.

Question: Why do you build upon eclipse? Just curious.

PhaserEditor2D commented 5 years ago

I assume you have an event listener for the selected node...

Is not that simple. Some time ago we tried to implement the multiple selection edit but it complicated the things more. The solution to that problem is to do a complete re-write of the properties editor, that is what we did in v2. To do a complete re-write (even using the "foundation" of v2) is a huge task and probably it will need some time to be stable. We are putting all our energies in develop v2, only small features or bug fixes will be implemented in v1.

Question: Why do you build upon eclipse? Just curious.

I ask myself the same question from time to time :) In short: we had some years of experience extending the Eclipse IDE and we decided to go with it to get something ready and more or less professional "quickly" (at the time, VSCode was not so popular as it is today, so the other options was to do it from scratch). Eclipse provides a lot of tools to build an IDE, especially if you want to make it huge (with a lot of editors and formats). We have the concept that if something is wrong with Phaser Editor it is not because it is implemented on top of Eclipse, else because we did it wrong because we did not have the vision. For example, the Canvas editor is implemented with JavaFX, that is good but it just simulates how a Phaser game should look. In Phaser Editor v2, we are going to embed a browser in the Scene editor and implement it with Phaser, so it should look pixel perfect.

What is a huge limitation with Eclipse is that users that want to extend it will need to learn Eclipse plugin development, and that could be a huge effort for HTML5 game developers. We are introducing this hybrid concept of embed web browsers in the IDE, and allow users to extend it with HTML5, but at this moment we are far to have it.

By the way, you can take a look at the External Tools menu. It is very flexible and you can run your scripts that modify the canvas files.

image

image

Thaval commented 5 years ago

Ui... I see. What a pity. I just got used to the editor :D But I see the lacks. However, some good work is done.

I'm looking forward to work with version 2 of the editor. I'd say I will contribute but I'm not as familiar with Phas 3/2/CE as I should be to contribute good stuff. And I've never implemented a hybrid version (embedding browser into Desktop App)

PhaserEditor2D commented 5 years ago

Yes, we should move forward with v2 because all Phaser community should move to Phaser 3. The Phaser 2 will be discontinued in the future by its developers. Feedback is a very good way to help the project, all ideas and bugs are welcome!

Thanks Arian