Ren’Py + Python: Part 3: User-Defined Displayables

1_Logo

Working with Ren’Py:

Advanced Ren’Py:

Customizing Ren’Py:

Ren’Py + Python:

Ren’Py is a engine for creating visual novels. It comes with a suite of tools for taking code and transforming it into programs that can be run on Windows, Mac, Linux, and even, with a little more work, mobile platforms like Android and iOS.

Beyond the showing of text and images, Ren’Py can also be extended through introducing new user interface elements, changing its defaults images, and combining Python with its own code to create even more interactive projects.


 

User-Defined Displayables

Along with using code in different blocks to change variables and define functions, Python can also be used more extensively. Code used within Ren’Py can use its classes and functions to create new objects that can interact with existing ones.

Along with other Displayables, user-created entries can be added. When used in an init python block, new classes can also inherit and use existing Ren’Py classes and properties.

Screenshot 2018-07-25 20.31.41

Note: User-created displayables need a minimum of both constructor and render functions defined to inherit properties from its parent and rules to follow when drawing.

Screenshot 2018-07-25 20.38.46

Defined as a displayable, new user-generated classes can be added and used with screens to access and show them to players.

Screenshot 2018-07-25 20.40.43

GitHub Gist Version: