Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Hii, so I have an imagebutton and I want that only if the condition canClick is True and you click the button, the action gets executed. I made the following code and it's working fine. The problem is that everytime "canClick" changes from True to False or viceversa, the animation image "animation1" gets restarted to the first frame. I really don't know how to solve this issue and I haven't found a solution online. Thanks for reading, and it's also my first time posting here
default canClick = False
##This is the animation I'm using as an image for the imagebutton
image animation1:
"images/Tuto/1.png"
pause 1.0
"images/Tuto/2.png"
pause 1.0
"images/Tuto/3.png"
pause 1.0
"images/Tuto/4.png"
pause 1.0
repeat
##This is the screen and imagebutton code
screen TUTORIAL1:
imagebutton:
at dissolve_with_atl2(0.2)
idle "animation1"
focus_mask True
if canClick == True:
action [Hide("TUTORIAL1"),Jump("TUTO1")]