Code: Select all
transform turn(angle):
rotate angle
transform crop():
crop (0, 0, 200, 300)
screen foo(angle):
default hovered = False
add At("gui/window_icon.png", turn(angle), crop)
textbutton "Button":
action Return(0)
hovered SetScreenVariable("hovered", True)
label start:
scene bg room
call screen foo(180)
"!"
return
When I mouse over the button, the image suddenly un-rotates, and is shown as if it only has the crop() transform applied. This happens if the button has SetVariable() or SetScreenVariable() as a hover action (admittedly I didn't test all the actions... but things like Play() seem to be fine).
This also only happens if the turn() transform takes a parameter ("angle"). If it's a rotation by some literal number such as "rotate 180", and the parameter is removed from the transform's definition, it'll be fine. But for my use case I kinda need the parameter.
Is this a screen prediction thing? How do I get around this?
It seems to work fine if I use a variable defined in python, as a statement or in an init block:
Code: Select all
transform turn():
rotate angle
transform crop():
crop (0, 0, 200, 300)
screen foo():
default hovered = False
add At("gui/window_icon.png", turn, crop)
textbutton "Button":
action Return(0)
hovered SetScreenVariable("hovered", True)
label start:
scene bg room
$ angle = 180
call screen foo
"!"
return