Hi there
I’ve startet using babylon only for a few hours and I’ve walked into a problem with some GUI elements.
I have a textBlock which has a height of 40% of the parent ractangle. both of them are combined in a other rectangle and there is also a image with the height of 60%. if the parent rectangle is declared with size: 18 (so a 1:1) the text is not disorted… does anyone know, why this is happening?
With 1:1 (size: 18)
![image](https://global.discourse-cdn.com/business7/uploads/babylonjs/original/3X/0/b/0bd5f1d44541df1457ec7c901594db68af56c9a8.jpeg)
With width: 18, height: 14
![image](https://global.discourse-cdn.com/business7/uploads/babylonjs/original/3X/0/5/05eaeb483d559cb3f7bc39ef91de90ea5d599028.png)
Thank you for showing me some clarity ![:slight_smile: :slight_smile:](https://emoji.discourse-cdn.com/win10/slight_smile.png?v=12)
Hello and welcome !
Best is to provide a Playground to reproduce the issue ![:slight_smile: :slight_smile:](https://emoji.discourse-cdn.com/win10/slight_smile.png?v=12)
I don’t know how you have set up your image and text within the rectangle, but indeed, changing the parent size should not affect the text distortion.
![gui](https://global.discourse-cdn.com/business7/uploads/babylonjs/original/3X/9/a/9ac593b2abd325a3150a58b831833714990f84db.gif)
Playground
++
Tricotou
2 Likes
I also noticed that the texture resolution ratio must coincide with the mesh aspect ratio, otherwise the texture is distorted
Let me add @RaananW our Gui expert
That looks like whats happening! How could I solve that with Code? Not sure what you mean by texture resolution ratio ![:open_mouth: :open_mouth:](https://emoji.discourse-cdn.com/win10/open_mouth.png?v=12)
For example, your mesh is 10x20 in size, then the texture resolution should correspond to the aspect ratio - 512x1024 or 64x128, etc.
Would be really great to see a reproduction, including the construction of the advanced dynamic texture ![:slight_smile: :slight_smile:](https://emoji.discourse-cdn.com/win10/slight_smile.png?v=12)
Hard to say what the problem is without that