|
5.
|
|
|
Using Styles and Style Inheritance
|
|
|
|
Using Styles and Style Inheritance
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/style.rst:30
|
|
6.
|
|
|
Each displayable has a style built-into it. When the displayable is created, either directly or using the screen system, style properties can be supplied to it, and these styles are used to update the look of the displayable. In the following example::
|
|
|
|
Each displayable has a style built-into it. When the displayable is created, either directly or using the screen system, style properties can be supplied to it, and these styles are used to update the look of the displayable. In the following example::
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/style.rst:32
|
|
7.
|
|
|
the :propref:`size` property is supplied to a Text displayable, allowing us to change its text size. This will customize the look of the text displayable by displaying the text 40 pixels high.
|
|
|
|
the :propref:`size` property is supplied to a Text displayable, allowing us to change its text size. This will customize the look of the text displayable by displaying the text 40 pixels high.
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/style.rst:39
|
|
8.
|
|
|
Similarly, when using Screen Language, each user interface statement takes relevant style properties::
|
|
|
|
Similarly, when using Screen Language, each user interface statement takes relevant style properties::
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/style.rst:43
|
|
9.
|
|
|
Ren'Py supports style inheritance, with each style having a single parent. If a style property is not defined in a style, the value of the property is inherited from the closest parent, grandparent, or other ancestor.
|
|
|
|
Ren'Py supports style inheritance, with each style having a single parent. If a style property is not defined in a style, the value of the property is inherited from the closest parent, grandparent, or other ancestor.
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/style.rst:49
|
|
10.
|
|
|
Each displayable takes a property named ``style``, which gives the parent of the displayable's style::
|
|
|
|
Each displayable takes a property named ``style``, which gives the parent of the displayable's style::
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/style.rst:54
|
|
11.
|
|
|
When no ``style`` property is given, a parent is chosen based on the kind of displayable be that has been supplied. The parent chosen can be influenced by the :ref:`style_group <style-group>` property of user interface statements in the screen language.
|
|
|
|
When no ``style`` property is given, a parent is chosen based on the kind of displayable be that has been supplied. The parent chosen can be influenced by the :ref:`style_group <style-group>` property of user interface statements in the screen language.
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/style.rst:62
|
|
12.
|
|
|
When a style is defined without a parent being specified, a default parent is chosen for the style. If the style contains an underscore (_) in its name, the parent is named by removing everything up to and including the first underscore. For example, a style named ``my_button`` will inherit from ``button``. This inheritance can be changed using the style statement or by calling a method on a style object. When a style that does not exist is used, and the style has an underscore in its name, Ren'Py will create it using the default parent.
|
|
|
|
When a style is defined without a parent being specified, a default parent is chosen for the style. If the style contains an underscore (_) in its name, the parent is named by removing everything up to and including the first underscore. For example, a style named ``my_button`` will inherit from ``button``. This inheritance can be changed using the style statement or by calling a method on a style object. When a style that does not exist is used, and the style has an underscore in its name, Ren'Py will create it using the default parent.
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/style.rst:67
|
|
13.
|
|
|
Style names beginning with an underscore are reserved for Ren'Py use.
|
|
|
|
Style names beginning with an underscore are reserved for Ren'Py use.
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/style.rst:76
|
|
14.
|
|
|
As Ren'Py builds styles on startup, named styles should not be changed outside of init code.
|
|
|
|
As Ren'Py builds styles on startup, named styles should not be changed outside of init code.
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/style.rst:78
|