Dynamic Cursor Config

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
Mole-chan
Veteran
Posts: 333
Joined: Thu Aug 27, 2009 12:46 am
Completed: DUAEL, Escape from Puzzlegate
Projects: A Bird with Gold-Mended Wings
Deviantart: mole-chan
Skype: mole-chan
itch: moleworks
Contact:

Dynamic Cursor Config

#1 Post by Mole-chan »

Hello!
A bit of an odd question, but I am making a game that makes heavy use of Pygame, and one of the sections requires the mouse. Not a problem, except that I am trying to implement a custom mouse cursor. When this is in place, when Pygame runs, it doesn't display the cursor!

So I was wondering if there was any way to set the config.mouse at the beginning of the game, swap it out for default before the game is imported, and swap it back in after.

I've tried both having it check for a "pygame_active" variable and set the config accordingly, and just doing it directly before the game runs, to no avail.

It's not super critical, but it's a cute cursor and I'd like to be able to keep it in without making the minigame unplayable.

Any help would be appreciated ^^ Thank you

KimiYoriBaka
Miko-Class Veteran
Posts: 636
Joined: Thu May 14, 2009 8:15 pm
Projects: Castle of Arhannia
Contact:

Re: Dynamic Cursor Config

#2 Post by KimiYoriBaka »

have you tried using pygame to change it?

http://www.pygame.org/docs/ref/mouse.ht ... set_cursor

alternatively, you could try to hide the mouse cursor and then put your own image in place of it.

User avatar
Mole-chan
Veteran
Posts: 333
Joined: Thu Aug 27, 2009 12:46 am
Completed: DUAEL, Escape from Puzzlegate
Projects: A Bird with Gold-Mended Wings
Deviantart: mole-chan
Skype: mole-chan
itch: moleworks
Contact:

Re: Dynamic Cursor Config

#3 Post by Mole-chan »

KimiYoriBaka wrote:have you tried using pygame to change it?

http://www.pygame.org/docs/ref/mouse.ht ... set_cursor

alternatively, you could try to hide the mouse cursor and then put your own image in place of it.
I have tried using Pygame directly. None of the cursors work when set, they always complain that some arguments are missing. I'm guessing the way it formats the arguments with the asterisk instead of listing all of them confuses Ren'py. And some arguments (namely hotspot) don't have that much documentation.

oh? How would I go about doing that?

KimiYoriBaka
Miko-Class Veteran
Posts: 636
Joined: Thu May 14, 2009 8:15 pm
Projects: Castle of Arhannia
Contact:

Re: Dynamic Cursor Config

#4 Post by KimiYoriBaka »

try using this to make the cursor invisible:
http://www.pygame.org/docs/ref/mouse.ht ... et_visible

if that works, they you can use the pos value from any MOUSEMOTION events to check where the cursor is and place whatever image you want there.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Ocelot