I'm using this code, taken from here (viewtopic.php?f=8&t=37403&hilit=mouse)
Code: Select all
init 1 python:
def change_cursor(type="default"):
persistent.mouse = type
if type == "default":
setattr(config, "mouse", None)
elif type == "1":
setattr(config, "mouse", {"default": [("images/gui/cursor1.png", 0, 0)]})
elif type == "2":
setattr(config, "mouse", {"default": [("images/gui/cursor2.png", 0, 0)]})
if not hasattr(persistent, "mouse"):
change_cursor()
else:
change_cursor(persistent.mouse)
Code: Select all
$ change_cursor("1")
"Hey look at this cool cursor!"
$ change_cursor("2")
"Wow, another cool cursor!"
And things are working great when I test it out, but I'm a little unsure of how to exactly write the code in order to declare the "$ change_cursor("2")" in an imagebutton format. I've tried using a SetVariable and a SetScreenVariable but neither have worked.
So far what I have is:
Code: Select all
imagebutton auto "images/gui/inventory_screen/inventory_options_use_%s.png" xpos 0 ypos 0 focus_mask True action [ Hide("item_options"), Hide ("inventory_screen"), Show("inventory_button2"), SetVariable("item_use", "True"), SetVariable("inventory_look", "show"), SetVariable("change_cursor", "2"),]