|
3.
|
|
|
In Ren'Py, most dialogue is written using say statements. The look of dialogue may be customized on a per-character basis by using Character objects.
|
|
|
|
在Ren'Py中,大多数对话都是通过say语句表现的。对话文字的外观可以针对每个角色使用Character命令进行单独定制。
|
|
Translated and reviewed by
Huang Junjie
|
|
|
|
Located in
../../source/dialogue.rst:15
|
|
4.
|
|
|
Say Statement
|
|
|
|
Say语句
|
|
Translated and reviewed by
Hanming Wu
|
|
|
|
Located in
../../source/dialogue.rst:22
|
|
5.
|
|
|
The say statement is used for dialogue and narration. Since it's almost always the most frequently used statement in Ren'Py scripts, the say statement has a syntax that minimizes the overhead in writing it. Some example say statements are::
|
|
|
|
Say语句主要用于对话和叙述,它可能是Ren'Py脚本中使用最频繁的语句了,Say语句的语法简洁,达到事半功倍的效果。下面是一些say语句的例子:
|
|
Translated and reviewed by
Huang Junjie
|
|
|
|
Located in
../../source/dialogue.rst:24
|
|
6.
|
|
|
The first form of the say statement consists of a string by itself. This form is used for narration, with the narration being the contents of the string.
|
|
|
|
第一种格式只包含字串本身,这种形式用于记叙文,字串就是继续要描写的内容。
|
|
Translated and reviewed by
Huang Junjie
|
|
|
|
Located in
../../source/dialogue.rst:38
|
|
7.
|
|
|
The second form consists of two strings. The first string is the name of the character who is speaking, and the second is the dialogue being spoken.
|
|
|
|
第二种形式包含两个字串,第一个字串是角色的名字,第二个字串是角色的台词。
|
|
Translated and reviewed by
Huang Junjie
|
|
|
|
Located in
../../source/dialogue.rst:42
|
|
8.
|
|
|
The third form consists of a simple expression followed by a string. The simple expression should evaluate to either a string giving a character name, or a Character object. In the latter case, the character object is used to control how the dialogue is shown.
|
|
|
|
第三种形式由一个简单表达式和一个字串组成。表达式可以是表示角色的名字的字串,也可以是角色对象。当表达式为角色对象时,Character命令将被用来控制台词的显示风格。
|
|
Translated and reviewed by
Huang Junjie
|
|
|
|
Located in
../../source/dialogue.rst:46
|
|
9.
|
|
|
The final form consists of a string and a with clause which has a transition. In this case, the string is shown and a screen is shaked at the same time.
|
|
|
|
最后一种形式由一个字符串和包含过渡效果的with子句组成。在这个例子中,显示文本的同时屏幕会发生震动。
|
|
Translated and reviewed by
Hanming Wu
|
|
|
|
Located in
../../source/dialogue.rst:51
|
|
10.
|
|
|
Although the precise details of what a say statement does is controlled by the character object used, the usual effect of a say statement is to display dialogue on the screen until the user clicks to dismiss it, then to remove that dialogue on the screen.
|
|
|
|
虽然say语句的具体效果由Character命令控制,常见的say语句效果主要是显示对话并等待玩家点击,然后让该句对话从屏幕上移除。
|
|
Translated and reviewed by
Huang Junjie
|
|
|
|
Located in
../../source/dialogue.rst:56
|
|
11.
|
|
|
Certain characters have special meaning to Ren'Py, and so can't be used in dialogue strings. The ``{`` character begins a text tag, and the ``[`` character begins a substitution. To use them in dialogue, double them. It may also be necessary to precede a quote with a backslash to prevent it from closing the string. For example::
|
|
|
|
某些特定的字符对Ren'Py有特殊的意义,所以不能用在对话的文本中。比如"{"作为文本标签(text tag)的起始字符;"["提示后面的字串是一个变量名,实际显示时会显示变量的值。如果要在对话中使用这些特殊的字符的话,需要输入两次。在使用引号时前面需要加上反斜线来防止其被作为字符串的终止符。比如:
|
|
Translated and reviewed by
Huang Junjie
|
|
|
|
Located in
../../source/dialogue.rst:61
|
|
12.
|
|
|
Defining Character Objects
|
|
|
|
自定义Character对象命令
|
|
Translated and reviewed by
Huang Junjie
|
|
|
|
Located in
../../source/dialogue.rst:72
|