Ren'Py Trying to edit the "Quit" confirmation screen, not succeeding

TessaXYZ

Active Member
Game Developer
Mar 24, 2020
686
1,497
Hi all,
I'm trying to stylize the UI a bit. I replaced the "frame.png" with my own background, but Renpy appears to be resizing the image (it appears warped in-game). Where is Renpy defining the size of this element? I can't seem to find any sizing information.

Thanks!
 

MissFortune

I Was Once, Possibly, Maybe, Perhaps… A Harem King
Respected User
Game Developer
Aug 17, 2019
4,914
8,026
Generally speaking, unless you've deleted the standard code, you're going to find everything on the confirm of the screens.rpy.

I ran into a similar issue when I was working on mine, asked over on the Ren'py forums and ended up just kind of going my own way with it with an image button.

Code:
screen confirm(message, yes_action, no_action, yes_text=_("Yes"), no_text=_("No"), dont_ask_again=None):
    key "rollback" action NullAction()

    zorder 1000

    style_prefix "confirm"

    imagebutton:
        idle '#0003'
        hover '#0003'
        hovered Play("sound", "music/hover.wav")
        action NullAction()
    add 'conf' yzoom 1 xalign .5 yalign .5 xsize YOUR NUMBER HERE ysize YOUR NUMBER HERE
    viewport:
        xmaximum 540
        ymaximum 310
        add '#0000'
        xalign .5 yalign .5
        vbox:
            xmaximum 500
            ymaximum 250
            xpos 25
            ypos 5
            hbox:
                xsize 490
                ysize 210
                xalign .5
                yalign .5
                spacing 4
                text _(message):
                    size 15 font 'gui/missfortune/fonts/Wadik.otf'
                    color '#fff'
                    xalign .5
                    yalign .4
            hbox:
                xalign .5
                yalign .5
                xsize 490
                ysize 50
                if no_action is not None:
                    vbox:
                        xmaximum 130
                        ymaximum 45
                        xalign 0.5
                        yalign .5
                        viewport:
                            xmaximum 130
                            ymaximum 45
                            imagebutton:
                                idle 'button_0'
                                hover 'button_1'
                                hovered Play("sound", "music/hover.wav")
                                action no_action
                            text no_text xalign .5 yalign .48 font 'gui/missfortune/fonts/Wadik.otf' size 15 color '#FFFFFF'
                vbox:
                    xmaximum 130
                    ymaximum 45
                    xalign 0.5
                    yalign .5
                    viewport:
                        xmaximum 130
                        ymaximum 45
                        imagebutton:
                            idle 'button_0'
                            hover 'button_1'
                            hovered Play("sound", "music/hover.wav")
                            action yes_action
                        text yes_text xalign .5 yalign .48 font 'gui/missfortune/fonts/Wadik.otf' size 15 color '#FFFFFF'
'conf' is the file name for the confirmation screen/background itself. 'button_0', 'button_1' are the idle and hovered variation of the yes/no buttons. "xsize" and "ysize" are what you're going to want to toy with first. Then adjust the sizes of the text and buttons accordingly.

You don't have permission to view the spoiler content. Log in or register now.

Which gives a result like this:



Make sure the background you're using is big enough to fit the size you're looking for and you should be good to go.
 

TessaXYZ

Active Member
Game Developer
Mar 24, 2020
686
1,497
Thanks for taking the time to write all that out! Will give it a try tomorrow :)
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,369
15,284
Where is Renpy defining the size of this element?
In the "confirm_frame" style, declared in the "screens.rpy" file:
Code:
style confirm_frame:
    background Frame([ "gui/confirm_frame.png", "gui/frame.png"], gui.confirm_frame_borders, tile=gui.frame_tile)
    padding gui.confirm_frame_borders.padding
    xalign .5
    yalign .5
The gui. values being defined in the "gui.rpy" file.