I've been looking around in the cookbook and old forum posts, but I can't really seem to find anywhere that explains how to position a screen, image or similar displayable relative to another. In previous game making software, it was rather easily done by a function like "object.x+100", or something similar. But I've yet to figure out a way to do this in Renpy.
There are multiple places where I'd like to implement this kind of positioning, but most specifically in a horizontal inventory grid, and a phone where there are sometimes incoming messages that I would like to bring on top vertically, or stacking if you will. Here is a very simplified version of the latter's code; it would be nice if anyone had any suggestions on how to bring text_casper to push down the pre-existing text_mum!
Code: Select all
screen phonemain():
tag phone
modal True
zorder 2
add "images/scr_pmain.png" at truecenter
imagebutton:
idle "images/butt_invclose.png" #the x-button at the bottom
xalign 0.5 yalign 0.925
action Hide("phonemain")
if text_casper:##THIS IS THE BIT THAT I'D LIKE TO "PUSH DOWN" THE OTHER MESSAGE
imagebutton:
idle "images/scr_msgbg.png" #the rectangle
xalign 0.5 yalign 0.1
action Show("msgcenter")
if unread:
imagebutton:
idle "images/butt_unread.png" xpos 370 ypos 70 #the exclamation point
##THIS IS THE PART THAT DEALS WITH MESSAGE POSITIONING
vbox:
xpos 385 ypos 55 xmaximum 330
textbutton "SENDER\nThis is a random text string to act as a msg preview" action Show("msgcenter")
if text_mum:
imagebutton:
idle "images/scr_msgbg.png"
xalign 0.5 yalign 0.3
action Show("msgcenter")
vbox:
xpos 385 ypos 160 xmaximum 330
textbutton "MUM\nThis is a permanent text that will never be labeled unread." action Show("msgcenter")
What can I do to
a) Make Mum's text be on top until another one comes in
b) Stick the new text on top of hers
Thanks in advance for any pointers! I'm really new to Renpy still, so use your baby words, please!