Text in GUI TextBlock seems disorted

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

With width: 18, height: 14
image

Thank you for showing me some clarity :slight_smile:

Hello and welcome !

Best is to provide a Playground to reproduce the issue :slight_smile:


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
:arrow_right: 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:

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:
Hard to say what the problem is without that