|
3.
|
|
|
Creator-defined displayables are programmed entirely in Python, and we encourage you to have a reasonable degree of skill at object-oriented Python programming before you begin creating one.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/udd.rst:20
|
|
4.
|
|
|
Example
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/udd.rst:25
|
|
5.
|
|
|
Here's an example of a creator-defined displayable. This displayable changes renders its child with an alpha that is determined by the distance of the mouse pointer from the center of the child. ::
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/udd.rst:27
|
|
6.
|
|
|
To use the creator-defined displayable, we can create an instance of it, and add that instance to the screen. ::
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/udd.rst:106
|
|
7.
|
|
|
renpy.Displayable
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/udd.rst:123
|
|
8.
|
|
|
A creator-defined displayable is created by subclassing the renpy.Displayable class. A creator-defined displayable must override the render method, and may override other methods as well.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/udd.rst:125
|
|
9.
|
|
|
A displayable object must be pickleable, which means it may not contain references to objects that cannot be pickled. Most notably, Render objects cannot be stored in a creator-defined displayable.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/udd.rst:129
|
|
10.
|
|
|
Since we expect you to override the methods of the displayable class, we'll present them with the `self` parameter.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/udd.rst:133
|
|
11.
|
|
|
Base class for creator-defined displayables.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/udd.rst:138
|
|
12.
|
|
|
A subclass may override the constructor, perhaps adding new parameters. If it does, it should pass all unknown keyword arguments to the renpy.Displayable constructor, using code like::
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/udd.rst:142
|