What we want to try is to create a button that you can click, that will then slide over to the other side of the screen, revealing a displayable that contains icons and/or stats. If you click the button again, it should slide all the way back and hide the displayable again.
He's written code that will do this once fairly perfectly based on what we are trying to do, but it unfortunately won't do it properly after the first time round. After we get the button to slide to the right, and then back to the left, it henceforth teleports to the coordinate after we click the button instead of sliding.
Code: Select all
init -2:
transform slideRight:
xpos -0.1
linear 2.0 xpos 0.9
#repeat
transform slideLeft:
xpos 0.9
linear 2.0 xpos -0.1
#repeat
$ menuOpen = False
screen test:
if menuOpen:
imagebutton:
idle "#000"
hover "#00f"
xysize(100,100)
#xpos -0.1
action SetVariable( "menuOpen", (True if menuOpen == False else False) ) at slideLeft
elif not menuOpen:
imagebutton:
idle "#000"
hover "#00f"
xysize(100,100)
#xpos 0.9
action SetVariable( "menuOpen", (True if menuOpen == False else False) ) at slideRight
We are grateful for any assistance, thank you! >3<*