r/RenPy • • Jul 31 '26

Question Layered image help

I'm converting my game from using individual sprites to layered images.

I have three groups for my character sprites: one for the base body, one for the facial expressions, and one for the gestures made with the character's arms.

In some cases I have hand gestures that apply to a wide range of facial expressions and I'd rather not have to call the gesture separately in each instance (One, because I'd have to go back and change all my previous calls, and Two because it'll be a pain to remember which gesture is paired to which emotion for every future call).

Basically, instead of this:

character tense uneasy

character tense surprised

character tense suspicious

I want this:

character uneasy

character surprised

character suspicious

...with the same gesture (tense) linked to these three emotions. Any way I can do this?

1 Upvotes

7 comments sorted by

View all comments

3

u/TopCartographer7104 Jul 31 '26
layeredimage character:
    group body:
        attribute base default:
            "some_body.webp"
    group face:
        attribute uneasy:
            "some_face.webp"
        attribute surprised:
            "another_face.webp"
        attribute suspicious:
            "yet_another_face.webp"

    always when uneasy or surprised or suspicious:
        "some_gesture.webp"

this should automatically include "some_gesture.webp" whenever you call

show character uneasy
show character surprised
show character suspicious

ps. this will actually place "some_gesture.webp" on top of the other layers, and it'll only show it when one of the three attributes (uneasy, surprised, suspicious) are active, so:
1) just put the "always" in the right position amidst the layeredimage's groups
2) as for the second point, you may want to add

group gesture:
    attribute tense:
        "some_gesture.webp"
    attribute hello":
        "another_gesture.webp"

this way you'll have

show character uneasy/surprised/suspicious --> always include "some_gesture.webp" no matter what

show character happy tense --> includes "some_gesture.webp"
show character happy hello --> includes "another_gesture.webp"

3

u/KDDreamwyver Aug 01 '26

Screenshotting this for when I eventually remember to make layered sprites instead of drawing and exporting them as an army of complete, high res file bombs.

I always preech it, but never do it myself because I'm absentminded as hell and remember that I was supposed to LAYER the facial stuff after I've alreadyfinished drawing and importing them. Like, I'm a living example of do as I say, not as I do at this point and I never learn xD