GUI Editor - Suggestions for code generation

Hello,

In GUI Editor it is possible to export a layout as a snippet. This works fine for me but in current version it is only useful when I start from scratch.

Here some suggestions from my side:

  1. Additional possibilty to generade source code (like in node material editor)
    With this function, it would easier for me to extend my code with additional elements of gui editor. Now I can’t go this way because I have to transform the json property output in source code.

  2. Current snippet generation logic produce a huge amount of code. A simple textbutton with default setting create a json file with 2857 characters. Is it possible (maybe optional) to leave out the default properties and generate the json file only with changes?

Best regards, Stephan

Adding @msDestiny14

@msDestiny14 : One idea will be to generate XML code for the Babylon GUI via the GUI editor. This is what interests me in the end and would probably generate a lot less line of code as Stephan mentions.

Documentation about XML loader for Babylon GUI (Coupling to GUI editor would be great)

Hello hello. These is an interesting and great suggestions. As far as writing code from scratch this is a good point considering if you already have a gui implemented already.

I think we originally had a generate code button but decided against it for a couple of reasons. If you want to look how to access elements after loading from snippet I’d recommend checking out this PG I made: https://playground.babylonjs.com/#AJA7KA#8 Its very easy to add on to advanceTexture too.

As for second comment, yes this would probably be an optional solution we can look in later down the line. :slightly_smiling_face:

Thanks for the feedback!

1 Like

This is a cool suggestion too by slightly out of scope for the moment.