|
1.
|
|
|
In-Game Menus
|
|
|
|
In-Game Menus
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/menus.rst:9
|
|
2.
|
|
|
In many visual novels, the player is asked to make choices that control the outcome of the story. The Ren'Py language contains a menus statement that makes it easy to present choices to the user.
|
|
|
|
In many visual novels, the player is asked to make choices that control the outcome of the story. The Ren'Py language contains a menus statement that makes it easy to present choices to the user.
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/menus.rst:11
|
|
3.
|
|
|
Here's an example of a menu statement::
|
|
|
|
Here's an example of a menu statement::
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/menus.rst:15
|
|
4.
|
|
|
The menu statement begins with the keyword menu. This may be followed by a label name, in which case it's equivalent to preceding the menu with that label. For example::
|
|
|
|
The menu statement begins with the keyword menu. This may be followed by a label name, in which case it's equivalent to preceding the menu with that label. For example::
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/menus.rst:35
|
|
5.
|
|
|
The menu statement is followed by an indented block. This block may contain a :ref:`say statement <say-statement>`, and must contain at least one menu choice. If the say statement is present, it is displayed on the screen at the same time as the menu.
|
|
|
|
The menu statement is followed by an indented block. This block may contain a :ref:`say statement <say-statement>`, and must contain at least one menu choice. If the say statement is present, it is displayed on the screen at the same time as the menu.
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/menus.rst:42
|
|
6.
|
|
|
**Menu Choices.** A menu choice is an option the user can select from the in-game menu. A menu choice begins with a string. The string may be followed by an if-clause, which makes the choice conditional. The menu choice ends with a colon, and must be followed by a block of Ren'Py statements.
|
|
|
|
**Menu Choices.** A menu choice is an option the user can select from the in-game menu. A menu choice begins with a string. The string may be followed by an if-clause, which makes the choice conditional. The menu choice ends with a colon, and must be followed by a block of Ren'Py statements.
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/menus.rst:47
|
|
7.
|
|
|
When the choice is selected, the block of code is run. If execution reaches the end of this block of code, it continues with the statement after the end of the menu statement.
|
|
|
|
When the choice is selected, the block of code is run. If execution reaches the end of this block of code, it continues with the statement after the end of the menu statement.
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/menus.rst:54
|
|
8.
|
|
|
An if-clause consists of the keyword ``if``, followed by a python expression. The menu choice is only displayed if the expression is true. In the following menu::
|
|
|
|
An if-clause consists of the keyword ``if``, followed by a python expression. The menu choice is only displayed if the expression is true. In the following menu::
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/menus.rst:58
|
|
9.
|
|
|
The third choice will only be presented if the drank_tea variable is true.
|
|
|
|
The third choice will only be presented if the drank_tea variable is true.
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/menus.rst:70
|