Open TangentFoxy opened 7 years ago
Note that a tooltip will always linger as currently implemented if the item is destroyed beneath it and it is not moved, as it is only listening to mousemoved events.
See Guard13007/SCP-Clicker#2
Relevant notes from linked issue:
wheelmoved
events to the box containing them! Make the add_icon function set this handler on them. Also the tooltip needs its own update separate from everything else I believe, in order to keep accidental lingering boxes around. Not sure.
Inspired by the fact that I had to implement and position my own such feature for SCP Clicker. It'd be nice if the library handled positioning and potential problems automatically, but exposed the internals of the tooltip feature to customization.
Basically, the tooltip will check whatever is
pop.hovered
every frame, and only when something exists, create and move itself to the appropriate position. Whenpop.hovered
does not contain a tooltip data item, it does nothing.Not quite sure how I will allow customization, that will have to be implemented after I make something that is customizing it. (I imagine it is as simple as accessing
pop.tooltip.data
and modifying it.)