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.
prompt: SentencePrompt | Sentence | null | undefined
- See SentencePrompt or Sentenceconfig: MenuConfig
- MenuConfig
Public Method
constructor
Overload 1 of 2
prompt: SentencePrompt
- See SentencePromptconfig?: MenuConfig
- MenuConfig
Overload 2 of 2
prompt: Sentence
- The prompt of the menu, See Sentenceconfig?: 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 Sentenceaction: 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"),
])
prompt: SentencePrompt
- See SentencePromptaction: ActionStatements
- The action of the choice, See ActionStatements