LineEdit width

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By kronos999
:warning: Old Version Published before Godot 3 was released.

Hi. I am new to this amazing engine so I will make some stupid questions.
For now I have just one. I try to change LineEdit width through the inspector and through gdscript but nothing happens. Width remains 250. Is it normal this and we cannot change it or I do something wrong?

Thanks in advance

:bust_in_silhouette: Reply From: quinno

AFAIK, there is no “width” property in LineEdit. You can set the width with the left/right margins or the rect_size property (which sets the margins). You can also change the rect visually by dragging the handles in the viewport.

If this doesn’t work, I would guess something else is constraining the size (perhaps it’s in a container?)

Thanks for the answer. As i said i am new :). I wrote width but i ment the size property, the first value. It cannot be changed when it is less than 250. The same happens when i try to do it visually. It doesnt get smaller when it reaches 250.

Yes it is in a container but the container uses all the screen. Should i remove it?

kronos999 | 2017-06-09 06:10

i found out that if i use a font then i cannot resize it.

kronos999 | 2017-06-10 14:49

:bust_in_silhouette: Reply From: GlaDos28

You should use Min Size property in Rect tab in inspector. Set X value to what you would like to. The maximal width can be fixed or not depending on whether flag Expand To Text Length is toggled.

:bust_in_silhouette: Reply From: adabru

In Godot 3.2, you also have to decrease the custom constant minimum_spaces to achieve a very small size.