#Adjusting Chatbox Background
1 messages · Page 1 of 1 (latest)
I'm not sure how to actually approach doing something like this, any ideas?
Currently, the chatbox_container (vbox) is what holds text entries, its set to display them from bottom up.
Would i have to adjust its size dynamically? how would i even know what size to set to- i cant just make it bigger/smaller based on the number of messages in chat because some can take up multiple lines 🤔
basically like this (the background rect changed size)
(i think) if you make the panel a child of the container it'll scale automatically? not sure tho
Simple question... Why do you want to scale dynamically?
What do you get out of it?
He wants it...look at the image
I think he wants to resize dynamically the chatbox(the place where there are all the messages
yea i know
But simply why? Just keep it as large as the panel
cus it ugly
Ok i i think i've got it, my bad i've misunderstood
Give me 30 minutes and i'll show you how to do it
yeah, basically want it to be like the bottom 2
instead of how it currently is (top 2)- uses a load of extra space
ok isee what you've got there
basically you have the margin container a child of the panel
while the panel and the vbox should be the children of the margin container
I've made a video 3 seconds and i'll send it here
sorry for bad audio i'm in vacation and have no microphone
basically what you do is resize the main panel to be 20(or whatever pixel height you choose for the text to be) higher
you can change the pixel height of the text based on the screen height / 30 to get a bigger text based on bigger screens, you can customize this method a lot
tell me if it fixes your problem and sorry for being rude before
You can also change the origin of the panel so you have no problem of changin the position
i mean yeah i can adjust the textbox size and position whenever a message is sent, but not all messages are the same size vertically, and messages can be deleted to (2 lines takes up more space and i'm unsure if theres any way to have the computer know if theres 2 lines or 1 line being taken up.)
Rn im trying to use the func _on_chatbox_container_resized(): signal
and adjusting the size whenever this is called by grabbing the sizes of all messages inside it
If that's your concern you can just use the get_line_count method of text_edit
that seems so overcomplicated