# Babylon.gui problem

**URL:** https://forum.babylonjs.com/t/babylon-gui-problem/547
**Category:** Questions
**Created:** [January 3, 2019, 7:52pm UTC](https://forum.babylonjs.com/t/babylon-gui-problem/547 "2019-01-03T19:52:19Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![droggam](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/droggam/32/1660_2.png) [@droggam](https://forum.babylonjs.com/u/droggam)
#### Post date: [January 3, 2019, 7:52pm UTC](https://forum.babylonjs.com/t/babylon-gui-problem/547/1 "2019-01-03T19:52:19Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)
#### Post date: [January 3, 2019, 8:34pm UTC](https://forum.babylonjs.com/t/babylon-gui-problem/547/2 "2019-01-03T20:34:49Z")

</div>

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

---

<div class="post-metadata">

### Author: ![droggam](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/droggam/32/1660_2.png) [@droggam](https://forum.babylonjs.com/u/droggam)
#### Post date: [January 4, 2019, 3:12pm UTC](https://forum.babylonjs.com/t/babylon-gui-problem/547/3 "2019-01-04T15:12:06Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Wingnut](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/wingnut/32/53_2.png) [@Wingnut](https://forum.babylonjs.com/u/Wingnut)
#### Post date: [January 4, 2019, 3:31pm UTC](https://forum.babylonjs.com/t/babylon-gui-problem/547/4 "2019-01-04T15:31:16Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![droggam](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/droggam/32/1660_2.png) [@droggam](https://forum.babylonjs.com/u/droggam)
#### Post date: [January 4, 2019, 4:01pm UTC](https://forum.babylonjs.com/t/babylon-gui-problem/547/5 "2019-01-04T16:01:27Z")

</div>

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 =)
