simvx.core.ui.tooltip

TooltipManager — hover-triggered floating tooltip utility.

Module Contents

Classes

TooltipManager

Manages tooltip display for the UI system.

Data

API

simvx.core.ui.tooltip.__all__

[‘TooltipManager’]

class simvx.core.ui.tooltip.TooltipManager(show_delay: float = 0.5, screen_width: float = 800, screen_height: float = 600)

Manages tooltip display for the UI system.

Not a Control subclass. Intended to be owned by SceneTree or the application layer and updated each frame.

Example: tip = TooltipManager() # In the frame loop: control = tree._find_control_at_point(mouse_pos) tip.update(dt, mouse_pos, control) tip.draw(renderer)

Initialization

update(dt: float, mouse_pos, control_at_pos: simvx.core.ui.core.Control | None)

Update tooltip state. Call once per frame.

Args: dt: Frame delta time in seconds. mouse_pos: Current mouse position (Vec2 or tuple). control_at_pos: The topmost Control under the cursor, or None.

draw(renderer)

Draw the tooltip if visible. Call after all other UI drawing.