Documentation
Menu

Menu

⚠️

This page is under construction.

Menu lets you create a menu in your visual novel. It is used to navigate between different parts of the story.

Menu.prompt("What should I do?")
    .choose("Go left", [
        character1.say("I went left"),
        scene1.jumpTo(scene2)
    ])
    .choose("Go right", [
        character1.say("I went right")
    ])

Static Method

prompt

An alias of the constructor.

Public Method

constructor

Overload 1 of 2

Overload 2 of 2

  • prompt: Sentence - The prompt of the menu, See Sentence
  • config?: MenuConfig - MenuConfig

Chainable Method

choose

Create a branch of the menu. Choice prompt can be a sentence.

Overload 1 of 3

new Menu("what should I do?")
    .choose({
        choice: "go left",
        action: [
            character1.say("I went left"),
        ]
    })
  • choice: MenuChoice - The choice of the menu, See MenuChoice

Overload 2 of 3

new Menu("what should I do?")
    .choose(new Sentence("go left"), [
        character1.say("I went left"),
    ])
  • prompt: Sentence - The prompt of the choice, See Sentence
  • action: ActionStatements - The action of the choice, See ActionStatements

Overload 3 of 3

new Menu("what should I do?")
    .choose("go left", [
        character1.say("I went left"),
    ])