mouse coordinates
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.
mouse coordinates
I need a way to get the coordinates of the mouse to use them in tooltips, the thing is the tooltip is going to follow the mouse so I will also need something to constantly update the coordinates given to my tooltips. So can anyone help me out?
The true measure of a man is what he does with his power.
- Aleema
- Lemma-Class Veteran
- Posts: 2677
- Joined: Fri May 23, 2008 2:11 pm
- Organization: happyB
- Tumblr: happybackwards
- Contact:
Re: mouse coordinates
As far as I know, that can't be done in Ren'Py. There isn't anything that stores the coordinates of the mouse, since you can play the game on most any controller. The tooltips must be in a static place. Maybe you can try changing the mouse graphic? Haha, that probably can't change after the game runs, too, though. Sorry.
Re: mouse coordinates
IMO, tooltips following the mouse can be preety annoying. It's better to force them to be shown in one, pre-deterimned place and that can be done in many ways. If you have an object (a graphic or sprite) you can just write a code which will assign such a tooltip as a graphical sprite or even program them from scratch with python. Then, such tooltip will appear when you hoover your mouse pointer over such an object.
BTW. Could you be more specific and say what will be their purpose, as well where are they going to be used (ingame/menus/rpg battle sequences etc.)? We might help but we will need more info on what will/has to be done with them
BTW. Could you be more specific and say what will be their purpose, as well where are they going to be used (ingame/menus/rpg battle sequences etc.)? We might help but we will need more info on what will/has to be done with them
Re: mouse coordinates
well, they are'nt really important. theres a map, and the tooltip is just a small picture of what the room your mouse is hovered over is, and what it looks like from the inside. however if it cant be done then thats fine as well.
The true measure of a man is what he does with his power.
Re: mouse coordinates
Have you tried to define tooltips for every room with a specific coordinates?
Like
Like
Code: Select all
$ tt1 = Tooltip(10, 380, "Tooltip 1")
$ tt2 = Tooltip(40, 180, "Tooltip 2")
$ ui.textbutton("Button 1", clicked=do_somthing, hovered=tt1.show, unhovered=tt1.hide)
$ ui.textbutton("Button 2", clicked=do_somthing, hovered=tt2.show, unhovered=tt2.hide)
Who is online
Users browsing this forum: Majestic-12 [Bot]