Is this intended? Or am I doing something wrong?
Below is a greatly simplified, self-contained script that illustrates the issue. When the "child" screen is called directly, the SetScreenVariable actions update the "state" variable, causing the "ping" and "pong" buttons to alternate. However, when the "parent" screen is called (which "uses" the child screen), clicking on "ping" does not cause the "state" screen variable to change. (Or, if it does, the screen does not update to reflect that fact.)
Code: Select all
image bg = "#888"
label start:
scene bg
"First, calling the screen directly (press 'Return' when done)"
call screen child
"Now, calling the screen indirectly"
call screen parent
"Why the difference?"
return
style button_text:
color "#f00"
hover_color "#ff0"
screen child():
default state = 0
text "State: [state]" align(0.0,0.0)
textbutton "Return":
align(1.0,0.0)
action Return()
if state == 0:
textbutton "ping":
align (0.25,0.5)
action SetScreenVariable("state", 1)
if state == 1:
textbutton "pong":
align (0.75,0.5)
action SetScreenVariable("state", 0)
screen parent():
text "Parent" align(0.5,0.0)
use child