How to make a custom mouse cursor in the game?

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
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

How to make a custom mouse cursor in the game?

#1 Post by isobellesophia »

Hi,

I was actually thinking if its possible to make the mouse cursor in the game?

I have a image like this.
custommouse.png
custommouse.png (451 Bytes) Viewed 296 times
But i have no idea how to do it, can somebody help me how to make a code out of this?

Thank you!
I am a friendly user, please respect and have a good day.


Image

Image


User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: How to make a custom mouse cursor in the game?

#2 Post by Per K Grok »

isobellesophia wrote: Fri Feb 15, 2019 12:48 pm Hi,

I was actually thinking if its possible to make the mouse cursor in the game?

I have a image like this.

custommouse.png

But i have no idea how to do it, can somebody help me how to make a code out of this?

Thank you!
You put your mousepointer-image in the game folder and the following code. It could be somewhere before the start label in the script.rpy-file

Code: Select all

init python:
    setattr(config, "mouse", {"default": [("custommouse.png", 0, 0)]})
0,0 in the code is the pointers 'hotspot'. If your pointer does not go all the way to the top left corner you might have to change the numbers to where the point should be (or even better, trim the image so the pointer goes all the way to the corner)

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: How to make a custom mouse cursor in the game?

#3 Post by isobellesophia »

Per K Grok wrote: Fri Feb 15, 2019 1:41 pm
isobellesophia wrote: Fri Feb 15, 2019 12:48 pm Hi,

I was actually thinking if its possible to make the mouse cursor in the game?

I have a image like this.

custommouse.png

But i have no idea how to do it, can somebody help me how to make a code out of this?

Thank you!
You put your mousepointer-image in the game folder and the following code. It could be somewhere before the start label in the script.rpy-file

Code: Select all

init python:
    setattr(config, "mouse", {"default": [("custommouse.png", 0, 0)]})
0,0 in the code is the pointers 'hotspot'. If your pointer does not go all the way to the top left corner you might have to change the numbers to where the point should be (or even better, trim the image so the pointer goes all the way to the corner)
Thanks again, i'll try this!
I am a friendly user, please respect and have a good day.


Image

Image


Post Reply

Who is online

Users browsing this forum: No registered users