Babylon.gui problem

Hello what is the correct way to update for example a textbox on the run
as u play not during create scene time.?
I try update the text during runtime with a regular button in html.
but it always turn the screen black.
after a short period of showing the new text.
Is there anyone good in gui here that can help maybe what i understand
an advanceddynamictexture is suppose to be interactive during gameplay?

It is:) can you create a repro of your issue in the playground? This will be easier to help you then

i want to but it is in angular and the game is one class and the one class that calls all the rendering functions, is another. and I try to declare BABYLON.GUI.textbox for exampte in game class. and later
when createScene() and animate() is allready called… during gameplay if i call
this.game.textbox.text=‚Äúready‚ÄĚ
it render shortly and then all go black. is there another function i need to call, to keep rendering the
data? in PG everything is in createScene block so i was just curious do i need maybe to think around… again

Hi drog. Any errors seen on JS console… when screen turns black after text change?

Would you please try a Babylon GUI button to change text… just for testing?

Or maybe…

scene.onReadyObservable.add(function() { setTimeout(function(){ textblock.text="ready" }, 10000) }) (or similar)

Any info gathered with those tests? thx!

1 Like

thanks for support guys.
the reason i had trouble was i never called a text on creation even if just empty string
it crash if i try to instantiate Textblock.text first time after createscene i needed to
call it with an empty string in the createscene function
then after that now i can change it however i want
hope that makes sense =)

2 Likes