[SOLVED]How To Use Menu With Function

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
Nero
Veteran
Posts: 248
Joined: Tue Aug 09, 2016 2:59 pm
Contact:

[SOLVED]How To Use Menu With Function

#1 Post by Nero »

Hey I couldn't find in documentation how to use menu: of Ren'Py with python function.

Something like that. Same thing from label start just written in function

Code: Select all

def renpymenu(self):
    renpy.say(narrator "Do you want to continue?")
    "So how do I make menu here"


label start:
    "Do you want to continue?"
    menu:
        "Yes":
            "Do something"
        "No":
            "Do something else"
Last edited by Nero on Fri Sep 15, 2017 4:21 am, edited 1 time in total.

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

Re: How To Use Menu With Function

#2 Post by Imperf3kt »

I'd make a screen instead of a choice menu.
Sorry, I don't have enough time to elaborate.
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

Nero
Veteran
Posts: 248
Joined: Tue Aug 09, 2016 2:59 pm
Contact:

Re: How To Use Menu With Function

#3 Post by Nero »

I know that just wondering if there is easy way of doing it in case I need to do some quick menus I would rather use it like that than making screens.


Nero
Veteran
Posts: 248
Joined: Tue Aug 09, 2016 2:59 pm
Contact:

Re: How To Use Menu With Function

#5 Post by Nero »

This is so confusing how do I use this? I hate when there isn't simple example to show me this in action...

Code: Select all

    def basic_menu(self):
        renpy.display_menu(items, interact=True, screen="choice")

philat
Eileen-Class Veteran
Posts: 1909
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: How To Use Menu With Function

#6 Post by philat »


Nero
Veteran
Posts: 248
Joined: Tue Aug 09, 2016 2:59 pm
Contact:

Re: How To Use Menu With Function

#7 Post by Nero »

Thanks got it to work now. This example should really be posted in documentation.

Post Reply

Who is online

Users browsing this forum: Bing [Bot]