Custom Mouse Cursor?

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
AngelicBlood
Regular
Posts: 88
Joined: Wed Feb 06, 2013 11:08 am
Projects: House of Hearts
Location: Narnia
Contact:

Custom Mouse Cursor?

#1 Post by AngelicBlood »

Hi, noob talking here.
So, I learned that I could change the cursor, and wanting to be *cough*creative *cough*, I went to options.rpy and did that:

Code: Select all

    #########################################
    ## More customizations can go here.
    image cursor = "cursor.png"
    config.mouse = cursor
   
I must have done something wrong(OBVIOUSLY I ALWAYS DO SOMETHING WRONG)
So I got this:

Code: Select all

File "game\options.rpy", line 269: invalid syntax
    image cursor = "cursor.png"
Help me?._.

TrickWithAKnife
Eileen-Class Veteran
Posts: 1261
Joined: Fri Mar 16, 2012 11:38 am
Projects: Rika
Organization: Solo (for now)
IRC Nick: Trick
Location: Tokyo, Japan
Contact:

Re: Custom Mouse Cursor?

#2 Post by TrickWithAKnife »

Alex made a great guide on how to do this. You can find it here: http://lemmasoft.renai.us/forums/viewto ... 51&t=17933

It's a lot longer, but a lot more flexible as well, just in case you want to have multiple mouse cursors.

If you want something simpler, check out Jake's code here: http://lemmasoft.renai.us/forums/viewto ... 757#p92757
"We must teach them through the tools with which they are comfortable."
The #renpy IRC channel is a great place to chat with other devs. Due to the nature of IRC and timezone differences, people probably won't reply right away.

If you'd like to view or use any code from my VN PM me. All code is freely available without restriction, but also without warranty or (much) support.

User avatar
AngelicBlood
Regular
Posts: 88
Joined: Wed Feb 06, 2013 11:08 am
Projects: House of Hearts
Location: Narnia
Contact:

Re: Custom Mouse Cursor?

#3 Post by AngelicBlood »

Thank you ^^

ukid
Newbie
Posts: 3
Joined: Tue Jun 19, 2012 2:04 am
Projects: kanji
Contact:

Re: Custom Mouse Cursor?

#4 Post by ukid »

thanks, I would just ask this question.

User avatar
AngelicBlood
Regular
Posts: 88
Joined: Wed Feb 06, 2013 11:08 am
Projects: House of Hearts
Location: Narnia
Contact:

Re: Custom Mouse Cursor?

#5 Post by AngelicBlood »

Problem is, I don't want an animated cursor..
And the "simple" way, with the config.mouse = "cursor.png" thingie gives me an error.

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

Re: Custom Mouse Cursor?

#6 Post by Alex »

You need to set it like

Code: Select all

init python:
    config.mouse = {"default": [("cursor.png", 20, 20)]}
http://www.renpy.org/doc/html/config.ht ... nfig.mouse

pwisaguacate
Veteran
Posts: 356
Joined: Mon Mar 11, 2013 11:03 pm
Contact:

Re: Custom Mouse Cursor?

#7 Post by pwisaguacate »

AngelicBlood wrote:Problem is, I don't want an animated cursor..
And the "simple" way, with the config.mouse = "cursor.png" thingie gives me an error.
The value goes by a (image, xoffset, yoffset) tuple. In other words, if the "click pixel" is exactly the top left of the image, then you would enter the following:

Code: Select all

init:
    $ config.mouse = {"default": [("cursor.png", 0, 0)]} # OR see below.

    #########################################
    ## More customizations can go here.
    config.mouse = {"default": [("cursor.png", 0, 0)]}

User avatar
AngelicBlood
Regular
Posts: 88
Joined: Wed Feb 06, 2013 11:08 am
Projects: House of Hearts
Location: Narnia
Contact:

Re: Custom Mouse Cursor?

#8 Post by AngelicBlood »

Thank you!It finally worked!Cursor is too big, though, lol. Time to fix this! ^^

Post Reply

Who is online

Users browsing this forum: No registered users