Ren'Py How to make an image (or images) move up as another appears in its place?

MissFortune

I Was Once, Possibly, Maybe, Perhaps… A Harem King
Respected User
Game Developer
Aug 17, 2019
4,941
8,066
It's kind of a tricky question to phrase. But basically, what I'm looking to do is have a series of tweets/social media posts pop up on the screen as the protagonist reads it. So, basically post #1 shows up on the screen > the player clicks > that first post moves upward and another takes its place. Think of it as something like a chat on Twitch. Here's a shitty image example:

1.png
2new.png

In essence, the tweets would be PNGs and would slide up with the behavior described above. I'm guessing this would either but done with ATL or NVL, but I'm not sure how I'd approach it with multiple images effectively interacting with each other in this way. A little guidance would be appreciated. :)
 

Winterfire

Forum Fanatic
Respected User
Game Developer
Sep 27, 2018
5,058
7,410
I'd use a vbox:


"This displays its children one above the other, in an invisible vertical box."

Which sounds about what you're looking for...
You could have an integer which increases everytime you want a new box to pop up, something akin to:


Python:
screen msgbox():
    vbox:
         if (i >= 1):
             #show box 1
         if (i >= 2):
             #show box 2
         (...)
Untested, and I don't remember if screens update automatically... if not, you can create a function (def) which does both increasing the integer AND recalling the screen so it updates.