Is there an easier way to get the x and y pos of the mouse pointer?
Thanks.
Get mouse position
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.
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.
-
- Regular
- Posts: 51
- Joined: Tue Jul 17, 2018 10:32 am
- Location: Philippines
- Contact:
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3794
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Get mouse position
Easier than what? What are you currently doing?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
- 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: Get mouse position
If you are looking for a way to check the x/y position in a scene, this could be a way.MisterHarold wrote: ↑Wed Mar 06, 2019 2:35 am Is there an easier way to get the x and y pos of the mouse pointer?
Thanks.
You just click at the place you want the values for, and they will be written out at the top left corner
Code: Select all
default mX=0
default mY=0
screen checkMPos():
text str(mX)+":"+str(mY)
key "mousedown_1" action [SetVariable("mX",renpy.get_mouse_pos()[0]), SetVariable("mY", renpy.get_mouse_pos()[1])]
-----
-----
show screen checkMPos
Who is online
Users browsing this forum: Ahrefs [Bot]