an other choice menu

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
sculpteur
Veteran
Posts: 312
Joined: Fri Nov 17, 2017 6:40 pm
Completed: Apocalypse Lovers
Projects: Apocalypse Lovers
Organization: Awake_Production
Location: France
Discord: https://discord.gg/apocalypse-lovers
Contact:

an other choice menu

#1 Post by sculpteur »

Hello,

Renpy is proposing a choice system by default, this is this screen if i'm not mistaken :

Code: Select all

screen choice(items):
    style_prefix "choice"

    vbox:
        for i in items:
            textbutton i.caption action i.action


## When this is true, menu captions will be spoken by the narrator. When false,
## menu captions will be displayed as empty buttons.
define config.narrator_menu = True


style choice_vbox is vbox
style choice_button is button
style choice_button_text is button_text

style choice_vbox:
    xalign 0.5
    ypos 1005
    yanchor 0.5

    spacing 0
    #Anciennement : gui.choice_spacing Ou gui.navigation_spacing
style choice_button is default:
    properties gui.button_properties("choice_button")

style choice_button_text is default:
    properties gui.button_text_properties("choice_button")
Renpy provides a simple way to modify certain characteristics if by chance the user wishes for example to position this screen elsewhere in the screen.

However, what I would like to do is not modify this screen but rather create a new one. At times I would like to use the base one, at other times use the new one.

The ideal would have been to copy and paste the "choice screen", rename it then modify it.

however the way to call this screen is not conventional and goes through:

Code: Select all

menu:
But I don't know how to modify this reference.

Maybe I could do something to get something like:

Code: Select all

menu2:
Does anyone have any idea how I could tackle this issue?
Image

“He asked me to calm down, close my eyes and be quiet. He explained to me that if I was afraid, the shadow that ran barefoot in the street would feel it. I got scared seeing Jumanji on TV, so let me tell you, we didn't stay hidden for long and had to start running again.”
Jessica's Diary.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2419
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: an other choice menu

#2 Post by Ocelot »

https://www.renpy.org/doc/html/menus.ht ... -arguments
Menu Arguments

It's possible to pass arguments to the menu itself, and to the individual choices in a menu. To pass arguments to the menu, add them to the menu line, after the optional name, and immediately before the colon. To pass arguments to a menu choice, put them after the menu string and before the if keyword or colon.

Code: Select all

menu ("jfk", screen="airport"):

    "Chicago, IL" (200):
        jump chicago_trip

    "Dallas, TX" (150, sale=True):
        jump dallas_trip

    "Hot Springs, AR" (300) if secret_unlocked:
        jump hot_springs_trip
Menu arguments passed to the menu itself become arguments to the screen, except the screen argument which selects the screen, and the nvl argument that selects the NVL-mode menu. There is also a special keyword _mode[c/] which will set the mode of this interaction, by default "menu". The arguments to the choices become arguments to the items passed to the menu screen.
< < insert Rick Cook quote here > >

sculpteur
Veteran
Posts: 312
Joined: Fri Nov 17, 2017 6:40 pm
Completed: Apocalypse Lovers
Projects: Apocalypse Lovers
Organization: Awake_Production
Location: France
Discord: https://discord.gg/apocalypse-lovers
Contact:

Re: an other choice menu

#3 Post by sculpteur »

Hey yes I saw this in my research but I was thinking it wasn't useful for what I want. I want to use 2 differents menu screen (Choice screen) , not simultaneously. Mainly i order to position them at different place of the screen. (one Bottom, one Right for exemple)

I'm not sure the menu arguments will allow me to do this. Or Am I wrong ?
Image

“He asked me to calm down, close my eyes and be quiet. He explained to me that if I was afraid, the shadow that ran barefoot in the street would feel it. I got scared seeing Jumanji on TV, so let me tell you, we didn't stay hidden for long and had to start running again.”
Jessica's Diary.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2419
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: an other choice menu

#4 Post by Ocelot »

It is literally property for choosing another screen to display menu instead of choice screen.

menu: is equivalent to menu(screen="choice")
< < insert Rick Cook quote here > >

Post Reply

Who is online

Users browsing this forum: Google [Bot]