Page 1 of 1

Custom Game Cursor

Posted: Wed May 01, 2013 9:11 am
by Vict0r1994
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?

Re: Custom Game Cursor

Posted: Thu May 02, 2013 12:38 am
by apricotorange
A quick search of this forum brings up this example of the syntax: http://lemmasoft.renai.us/forums/viewto ... e+#p247818 .

Re: Custom Game Cursor

Posted: Thu May 02, 2013 1:01 am
by pwisaguacate
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) ] }

Re: Custom Game Cursor

Posted: Thu May 02, 2013 6:06 am
by Vict0r1994
Thank you both! :D I used the latter suggestion for starters, but I'll probably customize my cursor further now that I know how to do it.

Re: Custom Game Cursor

Posted: Sun May 05, 2013 11:11 pm
by PyTom
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.)

Re: Custom Game Cursor

Posted: Mon May 06, 2013 12:28 am
by mugenjohncel
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.)
So umm.... what would be the new prefered way to do config.mouse... specifically, changing the way the cursor looks...

"POOF" (Disappears)

Re: Custom Game Cursor

Posted: Mon May 06, 2013 12:54 am
by PyTom
There isn't one, at the moment.

(I have vague plans, but they're months away at best.)