0 votes

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

in Engine by (12 points)

3 Answers

0 votes

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?)

by (58 points)

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?

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

0 votes

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.

by (26 points)
+4 votes

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

by (80 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.