jsfehler / renpy-mouse-tooltip

A Tooltip whose x/y position follows the mouse's.
MIT License
4 stars 1 forks source link

Code may be broken #2

Open BlueStylus opened 4 years ago

BlueStylus commented 4 years ago

Downloaded the files and launched in Renpy using Renpy Launcher (by the way, I needed to change the folder name from demo to game, Renpy Launcher wouldn't recognize demo folder name). Tooltip no longer follows mouse position, and no longer changes when hovered over a textbutton. The code might be outdated, but I don't understand it enough to revise it. Perhaps some syntax is outdated? Not sure what's going on.

jsfehler commented 4 years ago

Did you drop the demo file into a new game, or did you integrate a MouseTooltip into your own screen? If so, I need to see a minimal example of a screen that doesn't work.

BlueStylus commented 4 years ago

I downloaded the files here and tried to run it through the latest version of Renpy. I don't think I changed any of the code. But I can't seem to get the tooltip to follow the mouse, or change at all when I hover over the textbuttons. Here's a video: https://youtu.be/22vRYaDpp24

jsfehler commented 4 years ago

You can either set the MouseTooltip's redraw attribute to True after creating the object, or do something like:

textbutton:
    "One" 
    hovered [SetField(mtt, 'redraw', True), mtt.Action(Text("The loneliest number."))] 
    unhovered SetField(mtt, 'redraw', False)

To only redraw when the button is hovered. This prevents the tooltip from checking for updates every time you move the mouse, as opposed to only while hovering the button.

BlueStylus commented 4 years ago

That seemed to fix it. Here's the video of it working with the new code you provided: https://youtu.be/k04Bos2imA8 Do you want to update the code with this fix? I don't know if the fix keeps the intended effect of the original, but it may be helpful to provide it somewhere as an option. Sorry if I came off as rude, during our interaction and have a nice day!