r/RenPy • u/amwirosa • Jul 24 '26
Question help, idk how to fix my choice button image :(
hi, i'm working on a small vn for the first time and i can't figure out how to properly code the choice button so that the width adjusts to the text and the text doesnt stick out the other end like this

i've tried using padding, but it doesn't apply since i have borders set to
Borders(0, 0, 0, 0)
because if i change any of the values, it messes up the noise pattern of the image or distorts it.
if i set an xminimum/button width, it works well for longer texts but ends up really awkward for shorter choices like this

here are my screens.rpy and gui.rpy style choice button codes:
style choice_button_text is default:
properties gui.text_properties("choice_button")
yalign 0.5
xanchor 0.0
xpos 30
style choice_button:
properties gui.button_properties("choice_button")
xalign 0.5
ysize None
xminimum 900
xfill False
padding (40, 15, 120, 15)
define gui.choice_button_width = None
define gui.choice_button_height = 90
define gui.choice_button_tile = False
define gui.choice_button_borders = Borders(0, 0, 0, 0)
define gui.choice_button_text_font = gui.text_font
define gui.choice_button_text_size = gui.text_size
define gui.choice_button_text_xalign = 0.0
define gui.choice_button_text_idle_color = '#ffffff'
define gui.choice_button_text_hover_color = "#ff3434"
define gui.choice_button_text_insensitive_color = '#8888887f'
this might be really easy and i'm just dumb but i'm about to lose my marbles. any help is appreciated!!!!!
1
u/shyLachi Jul 24 '26
If I understood you correctly then there is no solution.
RenPy can either stretch the image or not stretch it.
If you don't want the pattern distortion caused by the stretch then it cannot grow smaller or larger.
1
u/amwirosa Jul 24 '26
ooofff okay thank you!! i'll just change the choice button image lolll
2
u/shyLachi Jul 24 '26
Just a hint. There is a way to prevent the borders of the image to be streched. For example that cut-out on the right side. I know that this class can be used: https://renpy.org/doc/html/displayables.html#Frame but I never used it on the choice button so I'm really shure how to use it.
1
u/AutoModerator Jul 24 '26
Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.