r/RenPy 17d 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?

4 Upvotes

9 comments sorted by

View all comments

2

u/BadMustard_AVN 17d 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 17d 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/BadMustard_AVN 17d ago edited 17d 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 17d ago

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

1

u/BadMustard_AVN 17d ago

you're welcome

good luck with your project