Changing cursor by clicking on a button?
Posted: Sun Nov 15, 2015 12:13 pm
Hello, I'm trying to make a screen in which if I select a button, the cursor changes.
Below is the code that I'm using.
The thing is, the cursor flickers a bit to the desired cursor, but quickly changes to the default cursor.
Thanks for any help!
Below is the code that I'm using.
Code: Select all
## HANDS BUTTON ##
imagebutton:
xpos 921
ypos 87
idle "foreplay/handbutton_idle.png"
hover "foreplay/handbutton_hover.png"
action SetScreenVariable('mousepointer', 1)
## MOUTH BUTTON ##
imagebutton:
xpos 1026
ypos 87
idle "foreplay/mouthbutton_idle.png"
hover "foreplay/mouthbutton_hover.png"
action SetScreenVariable('mousepointer', 2)
## CLOTHES BUTTON ##
imagebutton:
xpos 1131
ypos 87
idle "foreplay/clothesbutton_idle.png"
hover "foreplay/clothesbutton_hover.png"
action SetScreenVariable('mousepointer', 3)
if mousepointer == 1:
$ config.mouse = {"default" :[("foreplay/cursorhand.png", 0, 0)]}
elif mousepointer == 2:
$ config.mouse = {"default" :[("foreplay/cursormouth.png", 0, 0)]}
elif mousepointer == 3:
$ config.mouse = {"default" :[("foreplay/cursorclothes.png", 0, 0)]}
else:
$ config.mouse = {"default" :[("foreplay/cursordefault.png", 0, 0)]}Thanks for any help!