Advanced Ren’Py: Part 2: Position Style Properties


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.


Position Style Properties

The first part of the Advanced Ren’Py series introduced the screen language and many of the containers and windows that can hold user interface elements. Beyond those that can help with arranging elements like hbox and vbox, there are position style properties that can help in aligning and positioning elements within the larger groupings.

xpos and ypos

The starting position of x, xpos, and y, ypos, relative to the left side of the element.

Screenshot 2018-07-06 21.23.01

Screenshot 2018-07-06 21.23.49


xanchor and yanchor

The position anchor of the x, xanchor, and y, yanchor.

Screenshot 2018-07-06 21.36.34

Screenshot 2018-07-06 21.37.15


xalign and yalign

Sets the position (xpos or ypos) and anchor (xanchor or yanchor) in relation to the screen starting with 0.0 for leftmost and 1.0 for rightmost sides.

Screenshot 2018-07-06 21.42.03

Screenshot 2018-07-06 21.42.44


xmaximum and ymaximum

Set the maximum horizontal, x, and vertical, y, size of the displayable in pixels.

Screenshot 2018-07-06 21.50.12

Screenshot 2018-07-06 21.50.45



Set the xpos, ypos, width, and height of the displayable. (Does not work with all displayables.)

Screenshot 2018-07-06 21.59.23

Screenshot 2018-07-06 21.59.54