Adding Mouse gestures to a Ren'Py VN?

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
Katy133
Miko-Class Veteran
Posts: 704
Joined: Sat Nov 16, 2013 1:21 pm
Completed: Eight Sweets, The Heart of Tales, [redacted] Life, Must Love Jaws, A Tune at the End of the World, Three Guys That Paint, The Journey of Ignorance, Portal 2.5.
Projects: The Butler Detective
Tumblr: katy-133
Deviantart: Katy133
Soundcloud: Katy133
itch: katy133
Location: Canada
Contact:

Adding Mouse gestures to a Ren'Py VN?

#1 Post 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?
ImageImage

My Website, which lists my visual novels.
Become a patron on my Patreon!

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: Adding Mouse gestures to a Ren'Py VN?

#2 Post 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.

Post Reply

Who is online

Users browsing this forum: Bing [Bot]