|
91.
|
|
|
:dfn:`Call`
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/language_basics.rst:362
|
|
92.
|
|
|
Python expressions can call a function which returns a value. They begin with an expression (usually a variable), followed by a left-parenthesis, a comma-separated list of arguments, and a right-parenthesis. The argument list begins with the position arguments, which are python expressions. These are followed by keyword arguments, which consist of the argument name, and equals sign, and an expression. In the example example::
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/language_basics.rst:346
|
|
93.
|
|
|
we call the Character function. It's given one positional argument, the string "Eileen". It's given two keyword argument: ``type`` with the value of the ``adv`` variable, and ``color`` with a string value of "#0f0".
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/language_basics.rst:356
|
|
94.
|
|
|
Constructors are a type of function which returns a new object, and are called the same way.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/language_basics.rst:361
|
|
95.
|
|
|
When reading this documentation, you might see a function signature like:
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/language_basics.rst:364
|
|
96.
|
|
|
A sample function that doesn't actually exist in Ren'Py, but is used only in documentation.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/language_basics.rst:369
|
|
97.
|
|
|
This function:
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/language_basics.rst:372
|
|
98.
|
|
|
Has the name "Sample"
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/language_basics.rst:374
|
|
99.
|
|
|
Has two positional parameters, a name and a delay. In a real function, the types of these parameters would be made clear from the documentation.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/language_basics.rst:375
|
|
100.
|
|
|
Has one keyword argument, position, which has a default value of (0, 0).
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/language_basics.rst:378
|