|
89.
|
|
|
Python modules and objects have fields, which can be accessed with by following an expression (usually a variable) with a dot and the field name. For example::
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/language_basics.rst:336
|
|
90.
|
|
|
Consists of a variable (config) followed by a field access (screen_width).
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/language_basics.rst:342
|
|
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
|