Skip to content

Custom Displayables#

Making Silhouettes#

It is possible to turn any valid image that already exists into a silhouette via the create_silhouette method, which looks like this:

create_silhouette("<name of image>", r=0, g=0, b=0, a=1, dynamic_name=None)
# Create a black silhouette (default)
image john_silhouette = create_silhouette("john a_0")

# Create a white silhouette
image john_silhouette = create_silhouette("john a_0", 1, 1, 1)

# In some cases you may want to show a silhouette with the current state
# of the character, not as it was at the start of the game.
# In this case you can use a show expression:
show expression create_silhouette("john a_0")

# If you need to prepare a silhouette for later use, you can
# register it as an actual image using the advanced syntax:

# Prepare state
outfit john nude

# Register silhouette with a custom name
$ create_silhouette("john a_0", dynamic_name="sil_john_nude")

# Show silhouette
show sil_john_nude

In addition to specifying the image to turn into a silhouette you can also optionally add four number values which are one part of an RGBA color (Red, Green, Blue, Alpha/Opacity) each. The method will use this color to fill the silhouette. The values range from 0 (black) to 1 (white).

You can also specify the keyword dynamic_name to register the silhouette as an image for later use. This is an advanced feature that you will not need in the regular use case, so if you don't know why you need it, leave it be.


Last update: November 27, 2020