It seems like the Button class’s property textBlock should be serialized so that it’s available for GUI’s created with the GUI editor. Currently _textBlock is undefined for a parsed GUI’s buttons so the textBlock getter returns undefined as well.
This property is very handy for changing the button’s text when it’s clicked for example. My workaround for now is to populate _textBlock manually after loading the GUI, for each button whose text will need to be changed.
I’m happy to make a little PR to serialize it, lemme know if sounds good.
Sounds good to me, the element is probably already serialized as a child but not rehydrated after parse as it might be hard to identify why children is the image or textBlock if more elements have been added as children.
Good point. It’s a little trickier than the code I was using as a workaround, which assumed it was the only descendant.
So the solution I implemented was to serialize the name of _textBlock and _image and use that to know which parsed controls to reassign to _textBlock and _image when parsing the button. Which seems to work well from my initial testing.