any idea to getting mouse position in a screen continuously

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
Rnot2000
Regular
Posts: 42
Joined: Thu Oct 31, 2019 8:40 am
Contact:

any idea to getting mouse position in a screen continuously

#1 Post by Rnot2000 »

hello guys, any idea to getting mouse position in a screen continuously?

User avatar
Andredron
Miko-Class Veteran
Posts: 719
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: any idea to getting mouse position in a screen continuously

#2 Post by Andredron »

https://www.renpy.org/doc/html/other.ht ... _mouse_pos

renpy.get_mouse_pos()

If you watch renpy.get_mouse_pos() in the console (shift+O), it updates whenever the mouse button is released. So if I click and drag, it gives me the ending position. You can assign the coordinates to separate variables like

x, y = renpy.get_mouse_pos()

or

x = renpy.get_mouse_pos()[0]
y = renpy.get_mouse_pos()[1]

Post Reply

Who is online

Users browsing this forum: Bing [Bot]