#Custom panel sizes
1 messages · Page 1 of 1 (latest)
for example, i instanciate this rectangle background and adjust the text
the issue is if i make the box small the other texts look awful (like the leaf blade ability)
but if i make it a good width for that then the cooldown one looks awful.
is tehre a way to set maximum and minumum width or is that handled differently
i could just have 2 different scenes and instanciate them diffenetly based ont ext length but was wondering if theres a more elegant way to do it
You can set custom_minimum on controls either i the inspector or through code
There is no max_width. This is actually a problem in godot that is still discussed. Especially for text it would be quite useful, but currently you kinda have to hack.
https://github.com/godotengine/godot-proposals/issues/1802
Feel free to add to that issue, it might get reopened. Also there are some other solutions discussed there
isn't there a way to get the text's current occupying size, or a snap-to-size function? this feels like an XY problem if you only want to make text box size a function of text length