Make textbox change size according to the dialogue

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
WillandBran
Regular
Posts: 26
Joined: Fri Sep 08, 2017 8:18 am
Contact:

Make textbox change size according to the dialogue

#1 Post by WillandBran » Thu May 06, 2021 9:45 am

Hello,
I'm trying to tweak my textbook so that it automatically change sizes depending on how much text there is, basically exactly how the namebox works
But I have not a single clue about where to even start.

For instance:
dialogue2.png
dialogue2.png (3.59 KiB) Viewed 651 times
dialogue1.png
dialogue1.png (8.85 KiB) Viewed 651 times
Does anyone knows what code I could use to make the textbox's frame change according to the "what"'s size?

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1065
Joined: Tue Aug 23, 2016 10:35 am
Skype: miinipaa
Contact:

Re: Make textbox change size according to the dialogue

#2 Post by Ocelot » Thu May 06, 2021 9:52 am

Frame ( https://www.renpy.org/doc/html/screens.html#frame ) contains cacground which is stretched (or tiled) to match size of containing children.
Even more information about Frame:
https://www.renpy.org/doc/html/displayables.html#Frame
https://www.renpy.org/doc/html/gui.html#borders
< < insert Rick Cook quote here > >

WillandBran
Regular
Posts: 26
Joined: Fri Sep 08, 2017 8:18 am
Contact:

Re: Make textbox change size according to the dialogue

#3 Post by WillandBran » Thu May 06, 2021 10:21 am

Thank you !

I try using Frame like for the namebox but it's size don't change according to the what. It stick to xminimum and yminimum... é.è

Code: Select all

 style window:
    background Frame ("gui/textbox.png", 20,20,20,20, xalign=0.5, yalign=1.0)
I don't understand why the namebox size change according to the who but not the window according to the what.
Last edited by WillandBran on Thu May 06, 2021 10:47 am, edited 2 times in total.

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1065
Joined: Tue Aug 23, 2016 10:35 am
Skype: miinipaa
Contact:

Re: Make textbox change size according to the dialogue

#4 Post by Ocelot » Thu May 06, 2021 10:34 am

Are you sure that window style is applied to the what window and that nothing overwrites it?

Check the styles in the style inspector (Shift+I on the displayable you want to check).
< < insert Rick Cook quote here > >

WillandBran
Regular
Posts: 26
Joined: Fri Sep 08, 2017 8:18 am
Contact:

Re: Make textbox change size according to the dialogue

#5 Post by WillandBran » Thu May 06, 2021 11:08 am

I found the problem ! I have define incorrectly xmaximum and ymaximum !
Thank you a lot !!

Post Reply

Who is online

Users browsing this forum: Google [Bot]