documentation index

## Giving the User a Choice with Menus

Menus are implemented the menu statement, which is probably best explained by an example:

    menu:
        "Choice 1":
            "This is the result of the user choosing choice 1"
            bob "Hi Sarah."
            sarah "Hi Bob."
        "Second Choice":
            "This is the result of the user choosing the second choice."
        "The third menu option":
            "This is the result of the third menu option"
            bob "What up, Sarah?"
            sarah "Yo yo yo."
        "The fourth option doesn't do anything if you pick it":
            pass
        "The fifth option is a little different":
            bob "Hi Sarah. Hey, could you give me your sister's phone number?"
            sarah "Um, she doesn't have a telephone."

Menu choices can be as long as you like, and you can have as many of them as you like, provided that they can all fit on the screen. The results of menu choices can also be as long as you like, without restriction. Every line that's the result of a menu choice must be indented beyond the menu choice.

Please note that every menu option must have at least one statement, so if you want the menu option to do nothing, use the pass statement.

Previous: Adding Graphics to Your Story | Ren'Py Web Tutorial | Next: Remembering User Choices

documentation index