config.mouse cursor change not always changing

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
User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

config.mouse cursor change not always changing

#1 Post by Kinmoku »

Hello. Here's my code for having the mouse cursor change on hover...However, it's only working on buttons where I add "mouse 'imagemap'" to the end.

Code: Select all

define config.mouse = {
    "default": [('gui/cursor_big.png', 25, 25)],
    "menu": [('gui/cursor_small.png', 14, 14)],
    "mainmenu": [('gui/cursor_small.png', 14, 14)],
    "gamemenu": [('gui/cursor_small.png', 14, 14)],
    "imagemap": [('gui/cursor_small.png', 14, 14)]
    }
        
In screens:

Code: Select all

    imagebutton idle "main_fallenphoto" clicked Return('photo2') xpos 1243 ypos 841 focus_mask True mouse "imagemap" # works
    imagebutton idle "main_basketball" clicked Return('basketball') xpos 1282 ypos 852 focus_mask True # doesn't work
It also doesn't work on menus, main menu, game menu etc. Whilst I know I can add "mouse 'imagemap'" to every button in the game, I'm sure there's a more efficient way of doing so. How can I do this?

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: config.mouse cursor change not always changing

#2 Post by Alex »

Looks like it was working with layout menus (looong time ago). With screens it works like setting 'mouse' property for buttons/hotspots or like viewtopic.php?f=8&t=37403#p404987

User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: config.mouse cursor change not always changing

#3 Post by Kinmoku »

Alex wrote: Thu Apr 02, 2020 12:58 pm Looks like it was working with layout menus (looong time ago). With screens it works like setting 'mouse' property for buttons/hotspots or like viewtopic.php?f=8&t=37403#p404987
So the only way for it to work now is to add "mouse "imagemap"" on every button? Just checking before I add it to all my buttons!

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: config.mouse cursor change not always changing

#4 Post by Alex »

Using xala's sample you can change mouse pointer when entering the screen (like main and game menus) and make a listener screen that could change mouse pointer according to screen that is currently shown...

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]