# How to make my text fill the entire CreatForMesh?

**URL:** <https://forum.babylonjs.com/t/how-to-make-my-text-fill-the-entire-creatformesh/48989>\
**Category:** Questions\
**Tags:** gui\
**Created:** [March 23, 2024, 9:54am UTC](https://forum.babylonjs.com/t/how-to-make-my-text-fill-the-entire-creatformesh/48989 "2024-03-23T09:54:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhang](https://avatars.discourse-cdn.com/v4/letter/z/aeb1de/32.png) [@zhang](https://forum.babylonjs.com/u/zhang)\
**Post date:** [March 23, 2024, 9:54am UTC](https://forum.babylonjs.com/t/how-to-make-my-text-fill-the-entire-creatformesh/48989/1 "2024-03-23T09:54:10Z")

</div>

[Texture mode Babylon.GUI | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#ZI9AK7#3982)

How to make my text fill the entire CreatForMesh?

---

<div class="post-metadata">

**Author:** ![Joe\_Kerr](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joe_kerr/32/39017_2.png) [@Joe\_Kerr](https://forum.babylonjs.com/u/Joe_Kerr)\
**Post date:** [March 23, 2024, 1:02pm UTC](https://forum.babylonjs.com/t/how-to-make-my-text-fill-the-entire-creatformesh/48989/2 "2024-03-23T13:02:17Z")

</div>

Do you mean like this [https://playground.babylonjs.com/#ZI9AK7#3983](https://playground.babylonjs.com/#ZI9AK7#3983)?

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [March 24, 2024, 5:42pm UTC](https://forum.babylonjs.com/t/how-to-make-my-text-fill-the-entire-creatformesh/48989/3 "2024-03-24T17:42:37Z")

</div>

From the reading, no. I believe it’s the other way round, is it? @zhang.  
Although, I admit I wanted to reply yesterday but discarded it because I do not fully understand why someone would want to do this.

I drafted this reply yesterday:

_"You mean dynamically? No matter the number of characters, it will always fill the container (and not the other way round)._

_There are examples in the forum on how to make the container match the text input and I think, basically, you have to do the same. You will need to use ‘measureText()’ to get the size of the text input and (likely) instead of resizing the container to this, resize the font size or the textBlock container (that’s inside another container) with adaptWidthToChildren."_

Something like this example (but turned around to match your container size)

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

So, is that what it is? You really want to have a fixed width container and have your text content always match the width of this container, no matter how many characters?
