# GUI text not visible unless resizeToFit is true

**URL:** <https://forum.babylonjs.com/t/gui-text-not-visible-unless-resizetofit-is-true/30958>\
**Category:** Bugs\
**Tags:** gui\
**Created:** [June 1, 2022, 11:41am UTC](https://forum.babylonjs.com/t/gui-text-not-visible-unless-resizetofit-is-true/30958 "2022-06-01T11:41:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajp](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ajp/32/9504_2.png) [@ajp](https://forum.babylonjs.com/u/ajp)\
**Post date:** [June 1, 2022, 11:41am UTC](https://forum.babylonjs.com/t/gui-text-not-visible-unless-resizetofit-is-true/30958/1 "2022-06-01T11:41:26Z")

</div>

If you uncomment the line at the end (almost) of this playground script it will result in the “Some content text” being shown. I think this is a bug as it does not look like it needs to be resized and when `resizeToFit` is changed back to `false` the text still shows without problem?

> **[Babylon.js Playground](https://playground.babylonjs.com/#8K8U97%231)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![Vorion](https://avatars.discourse-cdn.com/v4/letter/v/d26b3c/32.png) [@Vorion](https://forum.babylonjs.com/u/Vorion)\
**Post date:** [June 1, 2022, 12:07pm UTC](https://forum.babylonjs.com/t/gui-text-not-visible-unless-resizetofit-is-true/30958/2 "2022-06-01T12:07:56Z")

</div>

A StackPanel needs the size (height or width depending on the orientation) of the child elements in pixel. resizeToFit sets the size in pixel, thats why the text is visible after setting this to true.  
It is described here in the docs

> **[The Babylon GUI | Babylon.js Documentation](https://doc.babylonjs.com/divingDeeper/gui/gui#stackpanel)**
>
> Learn all about the Babylon.js 2D GUI system.

Also you can see a warning about using percentage values in the browser console.  
If you manually set the height in pixel it will also work:

> **[Babylon.js Playground](https://playground.babylonjs.com/#8K8U97%232)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes
