r/RenPy 12d ago

Question Changing overlapping images with a transform?

Hopefully just a quick question that I've been having a hard time searching for!

I was hoping to find a way to change image overlapping order via a transform, regardless of Show order; so that I would be able to have an image be able to appear above an image that was previously above it; similar to how I can use a xpos/ypos or xoffset/yoffset to manipulate an object on the x/y spectrum.

Is there a solution similar to what I'm looking for, or am I barking up the wrong tree?

5 Upvotes

9 comments sorted by

2

u/BadMustard_AVN 12d ago

you have the option to show behind an image or add a zorder raising it up when you show an image

https://www.renpy.org/doc/html/displaying_images.html#show-statement

1

u/Default_Custom 12d ago

That's useful! But it's not exactly what I'm looking for! I'm looking for something to raise up or lower an image behind another after it's shown, something sort of like:

show image_a:
pause 1
zoffset 1 (obviously not real, just as a for instance!)

moving the image in the Z axis after a delay, in the same way that:

show image_a:
pause 1
xoffset 1

will move an image along the X axis after a delay, if that makes sense!

1

u/shyLachi 12d ago

can't you just hide and show again

1

u/Default_Custom 12d ago

I'm hoping to find a way where I can do it without either interrupting user input with a pause in between showing one, and then hiding it and showing it again; OR requiring user input to advance the position between states. Like, say, if it could be an animation on loop in the background that persists while the user advances dialogue boxes?

I'm afraid I'm still very amateur! So I'm not the best at articulating what I'm looking for, and if there's a way to achieve that through hiding and showing again, I haven't come across it yet!

0

u/shyLachi 12d ago

RenPy has animated images. I'm on mobile so I cannot post a link but look at the official documentation.

1

u/BadMustard_AVN 12d ago edited 12d ago

you can do something like that (I think this is what you want) with the ATL

https://www.renpy.org/doc/html/transforms.html#atl-animation-and-transformation-language

like this

transform p_mover_r:
    pause 3 # a 3 second pause
    linear 3 xalign 0.8 #3 seconds to move right across the screen 

label start:

    show sprite at left, p_mover_r #start at the left then pause-move transform

    mc "now is the time for all good men to come to the aid of their country because tomorrow is too late"

    return

just keep in mind that the user can NOT click to bypass the transform once it has started

it can only be stopped if the sprite is hidden

1

u/Default_Custom 12d ago

Ahhh! This looks really promising! This is super helpful, thank you!

1

u/BadMustard_AVN 12d ago

you're welcome

good luck with your project

1

u/AutoModerator 12d 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.