[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
Regular
Posts: 143
Joined: Tue Aug 09, 2016 2:59 pm
Contact:

[SOLVED]How To Use Menu With Function

#1 Post by Nero » Wed Sep 13, 2017 4:58 pm

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
Miko-Class Veteran
Posts: 826
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: How To Use Menu With Function

#2 Post by Imperf3kt » Wed Sep 13, 2017 5:37 pm

I'd make a screen instead of a choice menu.
Sorry, I don't have enough time to elaborate.
Image

Warning: May contain trace amounts of gratuitous plot.

Nero
Regular
Posts: 143
Joined: Tue Aug 09, 2016 2:59 pm
Contact:

Re: How To Use Menu With Function

#3 Post by Nero » Wed Sep 13, 2017 6:49 pm

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

Re: How To Use Menu With Function

#5 Post by Nero » Thu Sep 14, 2017 12:21 pm

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: 1194
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: How To Use Menu With Function

#6 Post by philat » Thu Sep 14, 2017 9:00 pm


Nero
Regular
Posts: 143
Joined: Tue Aug 09, 2016 2:59 pm
Contact:

Re: How To Use Menu With Function

#7 Post by Nero » Fri Sep 15, 2017 4:21 am

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

Post Reply

Who is online

Users browsing this forum: No registered users