Adjusting Quit screen

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
Mescalino
Newbie
Posts: 9
Joined: Fri Sep 15, 2017 5:40 am
Soundcloud: Mescalino
Contact:

Adjusting Quit screen

#1 Post by Mescalino »

I would like to recreate this exit screen.
I have 5 images ready:
yesno_ground.jpg
yesno_no_hover.jpg
yesno_no_idle.jpg
yesno_yes_hover.jpg
yesno_yes_idle.jpg

I have looked in the screen.rpy and gui.rpy but i do not see where i can change/adjust this. I saw this topic here:
viewtopic.php?p=298871

But though it gove insight it did not fully answer my question (or i didn't get it).
Attachments
Screenshot_1.jpg

User avatar
Dovahkitteh
Veteran
Posts: 229
Joined: Wed Sep 02, 2015 4:51 pm
Completed: YDD, RE, CoB, Req
Projects: Red Embrace: Hollywood, The Black Hand
Organization: Argent Games
Tumblr: argentgames
Skype: Dovahkitteh
itch: argent-games
Contact:

Re: Adjusting Quit screen

#2 Post by Dovahkitteh »

You'll want to go to the "confirm" section in screens.rpy, which is this:

Code: Select all

screen confirm(message, yes_action, no_action):
To add in the ground background image, you'll probably want to add this a couple lines below:

Code: Select all

add "gui/yesno_ground.jpg"
It sounds like your yes/no buttons are imagebuttons, so you'll want to add in something like this:

Code: Select all

imagebutton:
        idle "gui/yesno_yes_idle.jpg"
        hover "gui/yesno_yes_hover.jpg"
        action yes_action
        xpos 300
        ypos 900
        
imagebutton:
        idle "gui/yesno_no_idle.jpg"
        hover "gui/yesno_no_hover.jpg"
        action no_action
        xpos 800
        ypos 900
Hopefully this helps.
Image

Writer, Programmer, Designer

Programming/Design Commissions

Image Image

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Adjusting Quit screen

#3 Post by Imperf3kt »

That looks more like an imagemap, but the code is very similar (just that imagebutton is easier/uses less space)
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Mescalino
Newbie
Posts: 9
Joined: Fri Sep 15, 2017 5:40 am
Soundcloud: Mescalino
Contact:

Re: Adjusting Quit screen

#4 Post by Mescalino »

Ok i tried implementing it but its not completely right.

im a step further. It shows the ground image and i moved the text up (just wish it was a different collor and size probably need to do that in gui.rpy) but my buttons are not showing. This is (partly) the code of screen.rpy

Code: Select all

################################################################################
## Additional screens
################################################################################


## Confirm screen ##############################################################
##
## The confirm screen is called when Ren'Py wants to ask the player a yes or no
## question.
##
## http://www.renpy.org/doc/html/screen_special.html#confirm

screen confirm(message, yes_action, no_action):

    ## Ensure other screens do not get input while this screen is displayed.
    modal True

    zorder 200

    style_prefix "confirm"

    add "gui/yesno_ground.jpg"

    frame:
        vbox:
            xalign .5
            yalign .002
            spacing 30

            label _(message):
                style "confirm_prompt"
                xalign 0.5

        hbox:
            imagebutton:
                idle "gui/yesno_yes_idle.jpg"
                hover "gui/yesno_yes_hover.jpg"
                action yes_action
                xpos 300
                ypos 900

            imagebutton:
                idle "gui/yesno_no_idle.jpg"
                hover "gui/yesno_no_hover.jpg"
                action no_action
                xpos 800
                ypos 900
                

    ## Right-click and escape answer "no".
    key "game_menu" action no_action


style confirm_frame is gui_frame
style confirm_prompt is gui_prompt
style confirm_prompt_text is gui_prompt_text
style confirm_button is gui_medium_button
style confirm_button_text is gui_medium_button_text

style confirm_frame:
    background Frame([ "gui/yesno_ground.jpg"], gui.confirm_frame_borders, tile=gui.frame_tile)
    padding gui.confirm_frame_borders.padding
    xalign .5
    yalign .5

style confirm_prompt_text:
    text_align 0.5
    layout "subtitle"

style confirm_button:
    properties gui.button_properties("confirm_button")

style confirm_button_text:
    properties gui.button_text_properties("confirm_button")


Mescalino
Newbie
Posts: 9
Joined: Fri Sep 15, 2017 5:40 am
Soundcloud: Mescalino
Contact:

Re: Adjusting Quit screen

#5 Post by Mescalino »

i got it.

xpos and ypos shoudl be xalign and yalign

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]