8. Costumes and Background

8.1. Costumes

Each actor has one or more costumes.

A costume consists of one or more pictures and instructions on how to display them.

UML Diagram

8.1.1. Add images to a costume:

Add a new image to a costume:


In the same way you can also add several pictures to a costume:


8.2. Representation of pictures

The following instructions change the appearance of costumes:

8.2.1. Info Overlay

Shows an info overlay with frame and direction above the token.

8.2.2. is_rotatable

Specifies whether the image is rotated with the direction of the actor.

8.2.3. is_upscaled

Specifies whether the image should be upscaled to the size of the token. This action maintains the ratio between length and width.

8.2.4. is_scaled

Specifies whether the image should be upscaled to the size of the token. This action may change the size ratio between length and width.

8.2.5. is_textured

In addition to scale and upscale, there is also the option to “wallpaper” the background with an image for backgrounds.

8.3. Create multiple costumes

You can create several costumes as follows:

my_costume = self.add_costume("image.png")

A new costume is created with the image image.png. You can also add more pictures to the costume:


8.4. Switching between costumes

Here’s how you switch between two costumes:


The instruction jumps to the next costume. You can also specify a number as a parameter to jump to a specific costume.

8.5. The background

The playing field has a background. Many actions work similar to the costume, but there are some actions that only make sense for the background:

8.5.1. Show Grid Overlay

Displays margins for all cells.