Replace main menu of a blank project with this. Case 1, 2, and 3 play the animation properly, but for some reason case 4 doesn't animate.
Code: Select all
transform named_transform():
alpha 0
linear 0.5 alpha 1
repeat
screen screen_with_named_transform():
hbox:
transclude
text "this should be animated" at named_transform
screen screen_with_anonymous_transform():
hbox:
transclude
text "this should be animated":
at transform:
alpha 0
linear 0.5 alpha 1
repeat
screen main_menu():
$ var = NullAction()
vbox:
use screen_with_named_transform():
textbutton "case 1: included screen has a named transform, transcluded displayable takes a function → " action NullAction()
use screen_with_named_transform():
textbutton "case 2: included screen has a named transform, transcluded displayable takes a variable → " action var
use screen_with_anonymous_transform():
textbutton "case 3: included screen has an anonymous transform, transcluded displayable takes a function → " action NullAction()
use screen_with_anonymous_transform():
textbutton "case 4: included screen has an anonymous transform, transcluded displayable takes a variable → " action var
.
(
) but this works for me. You might be thinking, why not just use named transforms if you're going to create a whole new screen? Well, for me, screen_3 is used in a few different places, so I was going to reuse it anyway, and not using named transform makes my code more tidy.