I created a screen with some sort of map, this map will change depending if there is a "hidden" imagebutton from another screen. Example, if an imagebutton from another screen is placed in the northeast part of the gameplay area, the tracking screen should use the northeast map image. And should happen as soon as the screen with an imagebutton is shown, pseudo-realtime as it were. Here's the code:
Code: Select all
class MapDirection:
def __init__(self,nw,ne,sw,se):
self.nw = nw
self.ne = ne
self.sw = sw
self.se = se
screen test_frame: #the screen that will track the image button
frame:
xalign 1.0
yalign 0
background None
vbox:
showif MapDirection.nw == True:
add "images/DirectionEyeNW.png"
elif MapDirection.ne == True:
add "images/DirectionEyeNE.png"
elif MapDirection.sw == True:
add "images/DirectionEyeSW.png"
elif MapDirection.se == True:
add "images/DirectionEyeSE.png"
else:
add "images/DirectionEye.png"
screen test_button(direction):
if direction == 1:
$ MapDirection.nw = True
imagebutton auto "images/button_%s.png" action Jump("testnone") xpos 5 ypos 5 focus_mask True
screen test_button(direction):
if direction == 2:
$ MapDirection.ne = True
imagebutton auto "images/button_%s.png" action Jump("testnone") xpos 10 ypos 10 focus_mask True
label start:
"Frame"
show screen testframe
"Button1"
show screen test_button(1)
"Button2"
show screen test_button2(2)
Is this a limitation in Renpy itself? I'm guessing Renpy executes all screen code and just waits for it to be shown. Is there anyway to make this happen?