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.
The "fixed:" code seems to expand the vbox or frame to a huge size, probably to the screen size. This is the result: https://imgur.com/a/sKxwzc2
How can I get the frame to auto-scale with the child? So if the text was longer, like "blahblahblahblahblah", then the frame's width auto-scales to hold that text, and nothing more?
"This creates an area to which children can be added. By default, the fixed expands to fill the available area, but the xmaximum and ymaximum properties can change this." https://www.renpy.org/doc/html/screens.html#fixed
And as far as I'm aware, you should only really use fixed if you have no other container. I think.
Ah yeah, I figured xmaximum and such would do it, and it does work. However, I'm using fixed because I wanted to stack different elements together. ie, stacking a screen text and imagebutton together is done using fixed.
I was hoping the frame would still auto-calculate the size of the children, but because fixed screws up, I'll have to precalculate the sizes instead. Unless there is a more friendly way to stack a text on top of an imagebutton?
Don't know if this would help you or not but instead of using imagebuttons with text, I use textbutton and just change the background, hover_background etc.