I wanted to set it up so when the image appears for the first time, and when it's hidden, it does with a dissolve-like animation,
and when it's replaced with another image, it does with a sort of horizontal flip. This image represents a character going from
one stance to another, hence the need of using different animations for entering, exiting, and changing state.
So I declared the images like this, using ATL statements:
Code: Select all
image Hero_AttackPose:
"images/battler/Hero_attack.png"
on show:
alpha 0
linear .2 alpha 1.0
on replace:
linear .1 xzoom 0
linear .1 xzoom 1
image Hero_StandbyPose:
"images/battler/Hero_stand.png"
on show:
alpha 0
linear .2 alpha 1.0
on replace:
linear .1 xzoom 0
linear .1 xzoom 1
#This variable is used to change what image will be displayed
default Hero_BattlePose = 'Hero_StandbyPose'
Code: Select all
screen HR_Test():
#This displays the image
add Hero_BattlePose:
xalign .5
#The button to test wether the image changes on hover or not
textbutton "Attack":
xpos .2
ypos .7
hovered SetVariable('Hero_BattlePose', 'Hero_AttackPose')
unhovered SetVariable('Hero_BattlePose', 'Hero_StandbyPose')
action NullAction
but the 'replace' statement in them is never executed. If I place the xzooms inside the show block, they play correctly,
looks like only the show statement is executed as if each image it's showing for the first time, it doesn't seem to recognize the image is being replaced by another.
I thought of triggering the replace event myself somehow, or create a 'changeToAttackPose' event, but while the documentation states that you can generate your own events (I think?) it doesn't provide an example on how to do so, so I don't want to mess with it
until I know exactly what I'm doing.
So am I doing something incorrectly that does not trigger the 'replace' flag, or is my understanding or my entire approach on this problem wrong? Is there an example or a detailed explanation out there on how do this events work?
I've been stuck on this for days, any small help would be greatly appreciated.