custom per-gui element tooltip for minimap
Posted: Mon Oct 20, 2025 5:35 am
Hi,
I have a gui with a number of elements (for train stations and trains). I want to be able to hover over a gui element (usually a piece of text like "xyz station" or "abc train") and that should show a minimap of either the train or station position.
There seems to be no rich text element for the minimap, so using the regular tooltip seems out of the question.
I looked into using the on_gui_hover and on_gui_leave events and I can open and close a frame relative to element.gui.screen or element.gui.center. But it seems impossible to open a frame right on the location where the text element that I am hovering over is located. I tried element.gui.relative but that does not show anything and calling my_popup_frame.bring_to_front() crashes with "Only elements in 'gui.screen' can use bring_to_front".
Any ideas? I just ran out of ideas (and claude code did as well)?
I have a gui with a number of elements (for train stations and trains). I want to be able to hover over a gui element (usually a piece of text like "xyz station" or "abc train") and that should show a minimap of either the train or station position.
There seems to be no rich text element for the minimap, so using the regular tooltip seems out of the question.
I looked into using the on_gui_hover and on_gui_leave events and I can open and close a frame relative to element.gui.screen or element.gui.center. But it seems impossible to open a frame right on the location where the text element that I am hovering over is located. I tried element.gui.relative but that does not show anything and calling my_popup_frame.bring_to_front() crashes with "Only elements in 'gui.screen' can use bring_to_front".
Any ideas? I just ran out of ideas (and claude code did as well)?