The basic idea is: I show the player some facedown cards that they can click on. If the player hovers a card, it is flipped and reveal it's image, and I want this to have a sort of flip effect. So I made the card images using ConditionSwitch, with a variable to check if the card is being hovered or not. The problem is applying the transform to the card, IN the condition Switch. I thought of using At(), and it is shown allright, but the transform is never applied.
So, I'm guessing I'm doing something wrong or I just can't combine At with ConditionSwitch, so, I'm open to suggestions, alternatives. Here's what I have so far:
Code: Select all
#Some card images
image card_heart_a = "A_treb.jpg"
image card_back = "card_back.jpg"
#Transforms to apply to a card being flipped
transform hflip_in:
xzoom 0
linear .2 xzoom 1
transform hflip_out:
linear .2 xzoom 0
#A ConditionSwitch Image
image ace_of_hearts = ConditionSwitch(
"a_h_hovered", At("card_heart_a", hflip_in), #<- Problem here, ATL not working
"True", "card_back"
)
# Test variable used in the ConditionSwitch
default a_h_hovered = False
#A test screen
screen xtest():
#Add the image, not an imagebutton for now
add 'ace_of_hearts' at truecenter
#A textbutton to text flip effect
textbutton "Flip Me":
align (.5,.7)
hovered SetVariable("a_h_hovered", True) #Set the condition to True
unhovered SetVariable("a_h_hovered", False)
action NullAction()
label start:
scene black
call screen xtest