# Wierd gui glitches

**URL:** <https://forum.babylonjs.com/t/wierd-gui-glitches/38791>\
**Category:** Questions\
**Created:** [March 6, 2023, 7:33pm UTC](https://forum.babylonjs.com/t/wierd-gui-glitches/38791 "2023-03-06T19:33:41Z")\
**Posts on this page:** 1\
**Showing post:** 7

<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 9, 2023, 10:36am UTC](https://forum.babylonjs.com/t/wierd-gui-glitches/38791/7 "2023-03-09T10:36:59Z")

</div>

Did you try using scaleTo() for the ADT? It has recently received a fix and normally should render at new size without an update (altough I haven’t tried it). Anyways, what happens is that the ADT layer/texture does not rescale just on itself. You should try add this and see how it goes:

> [@Resize on different screen size](https://forum.babylonjs.com/t/resize-on-different-screen-size/30500/5):
>
> Every time the window resizes, you want to rescale the texture to the dimensions of the canvas. This ensures that it will always have the same resolution as the scene // adt is your AdvancedDynamicTexture, engine is your Babylon.js engine window.addEventListener("resize", () =\> { adt.scaleTo(engine.getRenderWidth(), engine.getRenderHeight()); });

---

_[View the full topic](https://forum.babylonjs.com/t/wierd-gui-glitches/38791)._
