Is there a way to include images inside Editor Script UI?
I am thinking about an idea to define auto-tiling rules and it would be nice to show the tile image in the middle and selections around in 4 or 8 directions to define rules, something like in LDtk (but different):
So I would like to create a visual widget in the middle with an image (a tile) from given tilesource. Is this possible? Or is planned for future? Or any tips for a workaround? I am aware of the predfined set of icons - maybe we can somehow alterate it?
I’m working on a runtime autotiling in Defold and this I imagine could be helpful to write down autotiling rules (but of course it can be done manually anyway).
I’m also trying to push how the editor extensions can be used. Images would be fantastic.
I have a script that based on the alpha of a png image can generate a polygon collision object for my pathdinding.
Well, loading the image turned out to be a no go as any pure lua library was failing in different ways.
I hate having executables lying around for this operations so I decided to bite the bullet and move everything into an in-game editor. While experimenting with the idea I got to the point where I’m essentially using Defold just to load the resources needed and I’m recreating the layout features of the editor in my in-game editor (plus everything else that is custom).
It works great but it’s also a lot of duplicated effort!
I might suggest something bold here: if the editor is not getting the necessary attention in terms of features and extensibility, how about creating a native extension that would help create these in-game editors? I’m talking about ui widgets, manipulators, resource handling, etc.
I agree! As with everything we do in Defold we develop things very iteratively. We start with the minimum that is needed to solve a problem. In the case of the new editor script UI functionality the goal was to reimplement the bundle dialogs using editor scripts and also use editor scripts to add bundle dialogs to the console builds (previously builds had to be made from command line using bob).
We have now achieved this first goal and have replaced the JavaFX+Clojure version of the bundle dialogs in the editor with JavaFX+Editor Scripts.
We do not yet know what the next step is. The feature requests and examples of use cases in this thread are an excellent way to help decide on next steps!
Could you please create a feature request on GitHub and add examples of how you would like to use images? We can then proceed to design this new part of editor scripts and eventually start an implementation.
One possibility is to add ability to add custom images as “icons” to be used in existing editor icon/button with icon, for example added to some catalog or near editor_script.
Other is to allow to somehow define path to such image and/or select image from Defold project image related resources (atlases and tilesources) as icon.
I am only thinking about “read-only” image component. As soon as we would be able to select any image path to such component, we could then possibly write scripts that even modify images, save them somewhere and load new modified ones to display.