How to make the players cursor move?

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
trashtank
Newbie
Posts: 2
Joined: Wed Dec 06, 2017 10:31 am
Tumblr: trashtank
Contact:

How to make the players cursor move?

#1 Post by trashtank »

Hi there, I tried to find answers for this through online searches but I couldn't quite find what I'm looking for. What I'm hoping to achieve is basically to have two choices on screen, with the cursor automatically pulling towards one of the choices so as to make the other more difficult to select. The user would be able to push against this, but it would reinforce a sense of it being an effort to make the choice they actually want to make. The best example of this I can find is this clip from Doki Doki Literature Club.https://youtu.be/QGMfy7zWp_4

Is this something that can be done? I would appreciate any answers or suggestions you can offer.

Thank you for reading!

DragoonHP
Miko-Class Veteran
Posts: 758
Joined: Tue Jun 22, 2010 12:54 am
Completed: Christmas
IRC Nick: DragoonHP
Location: Zion Island, Solario
Contact:

Re: How to make the players cursor move?

#2 Post by DragoonHP »

Well you can move the mouse using (I'm not sure what you mean by pulling; can't see the video)

Code: Select all

renpy.set_mouse_pos(x, y, time)
Replace x, y with the position/co-ordinates where the mouse should move to and time with how much time it should take the cursor to reach the provided co-ordinates.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: How to make the players cursor move?

#3 Post by Donmai »

I believe the game uses a python routine which checks the y position of the cursor and then forces it to move to the desired position. If the player manages somehow to click on an "undesired" option, then the game may "crash" (a fake glitch). That's very well done. I'm noticing several questions in this forum section related to DDLC programming tricks and special effects. Ren'Py game of the year, I guess.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

trashtank
Newbie
Posts: 2
Joined: Wed Dec 06, 2017 10:31 am
Tumblr: trashtank
Contact:

Re: How to make the players cursor move?

#4 Post by trashtank »

Thanks very much for your answers! I've made a note of it. I appreciate it a lot! :)

Post Reply

Who is online

Users browsing this forum: IrisColt