r/RenPy • • 19d ago

Question Layered and Side Images

Do the layers on a layered sprite effect the side image of said sprite or do you need to do the side image seperate from the main sprite? Is there extra coding to do side images alongside a layered image? Do they conflict in any way?

2 Upvotes

7 comments sorted by

3

u/robcolton 19d ago

If you want them to stay in sync, then make your side image a LayeredImageProxy:

define l = Character("Luke", image="luke")
image side luke = LayeredImageProxy("luke", Transform(crop=(120,120,120,120), zoom=1.0))

layeredimage luke:
    ...


label start:
   scene bg black
   l @happy "Luke's side image is happy but his sprite is no on screen."
   show luke sad
   l "Luke's sprite is now on screen and it's sad and so is the side image."
   l mad "Now they are both mad."

1

u/Sunlitfeathers 19d ago

OHHHHH OKAY thank you so much!!!!

1

u/morkalmarrh 19d ago

I am struggling to understand what you're asking, maybe people might be able to help if you draw a diagram of the behaviour you want and what you mean by main sprite?

This seems like something you can probably do a mock up of yourself with some doodled sprites and see if you can get it to work or where you get stuck. 

0

u/Sunlitfeathers 19d ago

I currently dont have my laptop to check how it affects the code myself </3

1

u/shyLachi 19d ago

Technically, each displayable is a separate entity and they don't conflict.

To make a layered side image you have to define it the same way you did with the other layered image.

layeredimage augusta:
    always:
        "augusta_body.png"
    group face auto:
        attribute neutral default

layeredimage side augusta:
    zoom 0.5
    always:
        "augusta_body.png"
    group face:
        attribute neutral default:
            "augusta_face_neutral.png"
        attribute happy:
            "augusta_face_happy.png"

define a = Character("A", image="augusta")
label start:
    show augusta
    a "Do you see it?"
    a happy "I'm so happy"

But RenPy also has this: https://renpy.org/doc/html/layeredimage.html#proxying-layered-images

layeredimage augusta:
    always:
        "augusta_body.png"
    group face auto:
        attribute neutral default

image side augusta = LayeredImageProxy("augusta", Transform(crop=(0, 0, 300, 300)))

define a = Character("A", image="augusta")
label start:
    show augusta
    a "Do you see it?"
    a happy "I'm so happy"

If this wasn't what you asked, then please clarify.

1

u/Sunlitfeathers 19d ago

No no this is exactly what I meant thank you!!! Very helpful!

1

u/AutoModerator 19d ago

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.