[SOLVED] Custom cursor for specific buttons

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.
Post Reply
Message
Author
DeftestHawk
Newbie
Posts: 4
Joined: Tue May 30, 2023 10:51 am
itch: python
Contact:

[SOLVED] Custom cursor for specific buttons

#1 Post by DeftestHawk »

I'm trying to figure out how to add the ability to switch custom cursors depending on the situation, for example I want only specific imagebuttons in my game to show a hand custom cursor. I tried looking at the wiki but the "Hardware Mouse Cursor" section doesn't explain how to achieve what I want.

Wiki: https://www.renpy.org/doc/html/mouse.html


This is the code I've added:

define config.mouse = { }
define config.mouse['default'] = [ ( "images/default.png", 0, 0) ]
define config.mouse['button' ] = [ ( "images/white_hand.png", 0, 0 ) ]
Last edited by DeftestHawk on Mon May 13, 2024 9:32 am, edited 1 time in total.

DeftestHawk
Newbie
Posts: 4
Joined: Tue May 30, 2023 10:51 am
itch: python
Contact:

Re: Custom cursors?

#2 Post by DeftestHawk »

I figured it out :)

define config.mouse = { }
define config.mouse['default'] = [ ( "images/default.png", 0, 0) ]
define config.mouse['white_hand' ] = [ ( "images/white_hand.png", 0, 0 ) ]


screen home:

imagebutton auto "images/home/miu01_%s.png" xpos 357 ypos 1143 action [Show("miu_home_main")] mouse "white_hand"

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot]