# GUI.AdvancedDynamicTexture.CreateFullscreenUI Clipping

**URL:** <https://forum.babylonjs.com/t/gui-advanceddynamictexture-createfullscreenui-clipping/3938>\
**Category:** Questions\
**Created:** [June 17, 2019, 3:56pm UTC](https://forum.babylonjs.com/t/gui-advanceddynamictexture-createfullscreenui-clipping/3938 "2019-06-17T15:56:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidworkman9](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/davidworkman9/32/2373_2.png) [@davidworkman9](https://forum.babylonjs.com/u/davidworkman9)\
**Post date:** [June 17, 2019, 3:56pm UTC](https://forum.babylonjs.com/t/gui-advanceddynamictexture-createfullscreenui-clipping/3938/1 "2019-06-17T15:56:42Z")

</div>

I’m experiencing some strange behaviour with the GUI.AdvancedDynamicTexture.CreateFullscreenUI when the user resizes the window. The text is much lower than the meshes it’s linked to:

![25%20AM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/d/d56d14e95810ae53be047ff3432d59db8e83b147.png)

I was able to somewhat fix this by dynamically setting the height of the GUIs canvas, like so:

```
engine.resize();
uiTexture.getContext().canvas.height = canvas.height;

```

But then I get this: (after a certain height the text starts to clip)

 ![21%20AM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/2/28e6980adde75d10185d3c7718c1d3fbe8c1fc78.png)

I’ve combed the documentation for the GUI.AdvancedDynamicTexture and there doesn’t seem to be a way to tell it to recalculate it’s size.

Note: I think the reason a lot of this is happening is that the height of my canvas is “flex” using CSS flexbox. Not shown in the code example is a hack I have to reset the canvas to the full height of it’s flexed container:

```
canvas.height = 1;
const rect = canvas.parentNode.getBoundingClientRect();
canvas.height = rect.height;
engine.resize();
uiTexture.getContext().canvas.height = canvas.height;
```

---

<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:** [June 17, 2019, 3:58pm UTC](https://forum.babylonjs.com/t/gui-advanceddynamictexture-createfullscreenui-clipping/3938/2 "2019-06-17T15:58:09Z")

</div>

Hello!

can you try texture.resize(…) to see if that suit your needs?

Else can you provide a simple repro in the playground to see what we can do 🙂 ?

---

<div class="post-metadata">

**Author:** ![davidworkman9](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/davidworkman9/32/2373_2.png) [@davidworkman9](https://forum.babylonjs.com/u/davidworkman9)\
**Post date:** [June 17, 2019, 4:00pm UTC](https://forum.babylonjs.com/t/gui-advanceddynamictexture-createfullscreenui-clipping/3938/3 "2019-06-17T16:00:48Z")

</div>

Hi @Deltakosh.

I get the following:  
`uiTexture.resize is not a function`

I don’t think I can create a repro in the playground since I have no control over the DOM nodes above the canvas, which I think is the root of the issue (CSS Flexbox)

EDIT:  
The `uiTexture` variable is initialized as follows:  
`uiTexture = GUI.AdvancedDynamicTexture.CreateFullscreenUI('UI', true, scene);`

---

<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:** [June 17, 2019, 4:05pm UTC](https://forum.babylonjs.com/t/gui-advanceddynamictexture-createfullscreenui-clipping/3938/4 "2019-06-17T16:05:47Z")

</div>

Sorry my bad, I wanted to say:

```auto
uiTexture.scaleTo(x, y)

```

---

<div class="post-metadata">

**Author:** ![davidworkman9](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/davidworkman9/32/2373_2.png) [@davidworkman9](https://forum.babylonjs.com/u/davidworkman9)\
**Post date:** [June 17, 2019, 4:12pm UTC](https://forum.babylonjs.com/t/gui-advanceddynamictexture-createfullscreenui-clipping/3938/5 "2019-06-17T16:12:24Z")

</div>

@Deltakosh, thank you! That worked wonderfully.
