Closed praine closed 7 years ago
There isn't really any documentation for changing text. There should be a multi paged documentation at some point.
Anyway, you can change a TextElement's value like so:
yourTextElement.text.text = 'My updated text.';
I would advise against destroying and re-creating panels, since it tends to go against object oriented design principles. A panel / button / text / anything should have one purpose and one purpose only. If you're using the same panel for multiple views, you might be doing something wrong.
Thanks for your prompt reply, Flaxis. I'll try updating the text with the method you provided.
I just noticed as well, that you should be able to use textElement.value = 'foo';
, since I apparently made a setter for it :)
Anyway, is this issue solved?
Thanks for that! Closing the issue now..
Hi there, thanks for this useful plugin. I'm trying to use it to dynamically generate multiple choice questions (see image). I either need to destroy the panel and create a new one each time a new question prompt occurs, or update the text on the buttons/elements.
I can't find anything in the documentation to destroy() or kill() panels once they have been created, nor any way to dynamically update button/element text.
Any help gratefully received.
Best, Paul