Min and Max label sizing?

Godot Version

4.2.1-stable-mono

Question

Min and Max Label sizing

Hello. I have a Label node with static text in it.

I want the label size to be a minimum of 100px.

If the text hits 200px width, I want it to text-wrap to the next line.

I just want some static text in a box that will adjust itself between 100-200px width.

Can someone explain a simple way to do this because I feel like a fool.

emm…Although I don’t know how to "If the text hits 200px width, text-wrap to the next line."but if you wanna text-wrap,you can find “autowrap_mode” in inspector,and change the mode.
By the way,about your issue,you can try “RichTextLabel”,it may help out.RichTextLabel allow you adjust the text by code.

custom maximum size is not yet exist on godot.

this only works with one line but it’s a start.
ok first click on your label then by the inspector click on the Node section then under the signals it will say “resized()” this is the signal that is fired every time the label is resized. right click to connect the signal to the label script you are working on.
func _on_resized() → void:
if size.x>200:
text=text.substr(0,len(text)-15)+“line \n”+text.substr(len(text)-15,len(text))

so when the resize signal is being fired the if checks if the size of the label is over 200, then it sets the text of that label to the sub string of the text and then adds the \n that is the new line symbol to it then it adds the rest of the sub string. but more logic is needed past the 1st line that you can work out if needed.
you can play with this by adding a text edit and then connecting the text _change() signal then setting the text edit text to the label text, like this.
@onready var text_edit: TextEdit = $“…/TextEdit”
func _on_text_edit_text_changed() → void:
text = text_edit.text