Page 1 of 1

Adding Mouse gestures to a Ren'Py VN?

Posted: Fri Dec 06, 2019 11:04 pm
by Katy133
I was reading about the development of the adventure game, Trauma, and discovered that the game was built using the Papervision 3D engine, which includes the ByteArray mouse gesture recognition library.

This is what I know so far:
  • Ren'Py includes a gesture recogniser, but it only seems to be enabled when a touchscreen is used.
  • ByteArray is Python-based, like Ren'Py.
  • It is possible to program mouse movements in Ren'Py: How to force move mouse?
So my question is: In Ren'Py, is it possible to program events to happen when the player uses mouse gestures, like in the game Trauma?

Re: Adding Mouse gestures to a Ren'Py VN?

Posted: Tue Dec 10, 2019 2:09 pm
by Per K Grok
Katy133 wrote:
Fri Dec 06, 2019 11:04 pm
I was reading about the development of the adventure game, Trauma, and discovered that the game was built using the Papervision 3D engine, which includes the ByteArray mouse gesture recognition library.

This is what I know so far:
  • Ren'Py includes a gesture recogniser, but it only seems to be enabled when a touchscreen is used.
  • ByteArray is Python-based, like Ren'Py.
  • It is possible to program mouse movements in Ren'Py: How to force move mouse?
So my question is: In Ren'Py, is it possible to program events to happen when the player uses mouse gestures, like in the game Trauma?
As far as I know (and there are loads of stuff that I don't know) there is no function for this directly in Renpy.

You can however get mouse positions with renpy.get_mouse_pos(). Using a time between two readings you could make something that would recognize certain mouse gestures. If xpos has moved more than a certain distance within a certain time and ypos has only moved within a certain small span that would be wipe left or right.

or you could look for a python library, that you could import, that provides that function. Someone is bound to have made one.

Sorry I don't have anything more directly helpful to contribute.