[SOLVED] Background image on yesno_prompt 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
User avatar
Shagwrath
Regular
Posts: 70
Joined: Tue Apr 12, 2016 8:08 pm
Projects: Shison L, Cosmic Raven
Organization: Progeny Gaming, LLC.
IRC Nick: Shagwrath
Deviantart: shawnbaybo
Location: St. Louis, MO. USA.
Contact:

[SOLVED] Background image on yesno_prompt screen

#1 Post by Shagwrath »

Hello all, my first post so sorry if I mess something up.

This is my first RenPy project.

I'm just trying to figure out how to add an image to the background of my yesno_prompt screen
Below is my code and the line 'background = "images/mm_bkrnd.jpg"' is what I'm trying to use to add the image, but it's wrong obviously because I'm getting errors.

You don't have to tell me how, but I would love to be pointed in the right direction.

Code: Select all

##############################################################################
# Yes/No Prompt
#
# Screen that asks the user a yes or no question.
# http://www.renpy.org/doc/html/screen_special.html#yesno-prompt

screen yesno_prompt(message, yes_action, no_action):

    modal True

    window:
        style "gm_root"
        background = "images/mm_bkrnd.jpg"

    frame:
        style_group "yesno"

        xfill True
        xmargin .30
        ypos .375
        yanchor 0
        ypadding .05

        has vbox:
            xalign .5
            yalign .5
            spacing 30

        label _(message):
            xalign 0.5

        hbox:
            xalign 0.5
            spacing 100

            textbutton _("{size=+24}Yes{/size}") action yes_action
            textbutton _("{size=+24}No{/size}") action no_action

    # Right-click and escape answer "no".
    key "game_menu" action no_action
Thanks in advance,
Shagwrath.
Last edited by Shagwrath on Tue Apr 12, 2016 8:46 pm, edited 1 time in total.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1962
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Background image on yesno_prompt screen

#2 Post by Donmai »

To show images on screens, you must use the 'add' statement (https://www.renpy.org/doc/html/screens.html#add)
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
Shagwrath
Regular
Posts: 70
Joined: Tue Apr 12, 2016 8:08 pm
Projects: Shison L, Cosmic Raven
Organization: Progeny Gaming, LLC.
IRC Nick: Shagwrath
Deviantart: shawnbaybo
Location: St. Louis, MO. USA.
Contact:

Re: Background image on yesno_prompt screen

#3 Post by Shagwrath »

Donmai wrote:To show images on screens, you must use the 'add' statement (https://www.renpy.org/doc/html/screens.html#add)
Thank you sir, worked without a problem

Completed code below

Code: Select all

##############################################################################
# Yes/No Prompt
#
# Screen that asks the user a yes or no question.
# http://www.renpy.org/doc/html/screen_special.html#yesno-prompt

screen yesno_prompt(message, yes_action, no_action):

    modal True

    window:
        style "gm_root"
        add "images/mm_bkrnd.jpg" xalign 0.0 yalign 0.0

    frame:
        style_group "yesno"

        xfill True
        xmargin .30
        ypos .375
        yanchor 0
        ypadding .05

        has vbox:
            xalign .5
            yalign .5
            spacing 30

        label _(message):
            xalign 0.5

        hbox:
            xalign 0.5
            spacing 100

            textbutton _("{size=+24}Yes{/size}") action yes_action
            textbutton _("{size=+24}No{/size}") action no_action

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

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], RewindTheGame