I had an idea about customizing the game cursor, and I found this information about configuration variables on the ren'py wiki:
config.mouse = None
This variable controls the use of user-defined mouse cursors. If None, the system mouse is used, which is usually a black-and-white mouse cursor.
Otherwise, this should be a dictionary giving the mouse animations for various mouse types. Keys used by the default library include "default", "say", "with", "menu", "prompt", "imagemap", "pause", "mainmenu", and "gamemenu". The "default" key should always be present, as it is used when a more specific key is absent.
Each value in the dictionary should be a list of (image, xoffset, offset) tuples, representing frames.
image
The mouse cursor image.
xoffset
The offset of the hotspot pixel from the left side of the cursor.
yoffset
The offset of the hotspot pixel from the top of the cursor.
The frames are played back at 20hz, and the animation loops after all frames have been shown.
However, I'm new to ren'py and I don't know how I could write the aforementioned list in code. To be honest, I don't know at all how lists should be defined or how they work, but I want to learn and I really want to implement a custom cursor. I've tried some codes, but I always get a parsing error. Can somebody help me?
Custom Game Cursor
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.
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.
-
- Newbie
- Posts: 19
- Joined: Mon Apr 08, 2013 10:46 pm
- Contact:
-
- Veteran
- Posts: 479
- Joined: Tue Jun 05, 2012 2:01 am
- Contact:
Re: Custom Game Cursor
A quick search of this forum brings up this example of the syntax: http://lemmasoft.renai.us/forums/viewto ... e+#p247818 .
-
- Veteran
- Posts: 356
- Joined: Mon Mar 11, 2013 11:03 pm
- Contact:
Re: Custom Game Cursor
If you're simply changing the mouse cursor for the whole game, then this should work:
Code: Select all
init:
$ config.mouse = { "default": [ ('mouse.png', 0, 0) ] }
-
- Newbie
- Posts: 19
- Joined: Mon Apr 08, 2013 10:46 pm
- Contact:
Re: Custom Game Cursor
Thank you both! I used the latter suggestion for starters, but I'll probably customize my cursor further now that I know how to do it.
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Custom Game Cursor
I don't recommend using config.mouse anymore. Changes in how video drivers work cause unacceptable lag on some computers. (Notably, the default Nvidia driver configuration lags a lot.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
- mugenjohncel
- Hentai Poofter
- Posts: 2121
- Joined: Sat Feb 04, 2006 11:13 pm
- Organization: Studio Mugenjohncel
- Location: Philippines
- Contact:
Re: Custom Game Cursor
So umm.... what would be the new prefered way to do config.mouse... specifically, changing the way the cursor looks...PyTom wrote:I don't recommend using config.mouse anymore. Changes in how video drivers work cause unacceptable lag on some computers. (Notably, the default Nvidia driver configuration lags a lot.)
"POOF" (Disappears)
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Custom Game Cursor
There isn't one, at the moment.
(I have vague plans, but they're months away at best.)
(I have vague plans, but they're months away at best.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Who is online
Users browsing this forum: No registered users