Skip to main content

Hoverer

Based on game build 714014 | Last updated: 2026-03-08

Overview

Hoverer is a UI widget that displays contextual hover text and action hints beneath or near the mouse cursor. It is responsible for synthesizing and rendering tooltip strings based on game state—such as the currently hovered object, active left/right mouse actions, and wetness status—and displaying them as primary and secondary text lines. It integrates with the playercontroller and HUD.controls components to pulltooltip data, and it dynamically adjusts its screen position to stay within viewport bounds.

Usage example

local hoverer = HoverText(owner)
owner.HUD.hoverer = hoverer
-- Hoverer automatically updates on `OnUpdate` and follows mouse position
-- Text content is derived from playercontroller and HUD state

Dependencies & tags

Components used: playercontroller, inspectable Tags: None identified.

Properties

PropertyTypeDefault ValueDescription
ownerentitynilThe entity (typically the player) that owns this hoverer.
isFEbooleanfalseFlag indicating if this is a FE (Front End) tooltip source.
shownbooleannilInternal state tracking tooltip visibility (not explicitly initialized in constructor).
forcehidebooleannilInternal flag to override automatic show/hide behavior.
default_text_posVector3Vector3(0, 40, 0)Default position offset for primary text.
textTextinstancePrimary text widget.
secondarytextTextinstanceSecondary text widget for RMB hints or extra context.
str, secondarystr, lastStrstring"" / nilCached tooltip strings for change detection and delayed rendering.
strFramesnumber0Frame counter used to delay text updates for smooth transitions.
followhandlerfunctionnilMouse move handler callback registered via TheInput.

Main functions

OnUpdate()

  • Description: Called each frame to update tooltip content, visibility, position, and appearance based on game state (mouse usage, hovered object, actions).
  • Parameters: None.
  • Returns: Nothing.
  • Error states: No explicit error handling; silently skips updates if playercontroller is missing or mouse is not in use.

UpdatePosition(x, y)

  • Description: Computes and sets widget position to clamp tooltip within screen bounds, accounting for text size and offsets.
  • Parameters:
    x (number) – Mouse X screen coordinate.
    y (number) – Mouse Y screen coordinate.
  • Returns: Nothing.

FollowMouseConstrained()

  • Description: Registers a mouse-move handler to update position dynamically and immediately positions the widget at the current cursor location.
  • Parameters: None.
  • Returns: Nothing.

Events & listeners

  • Listens to: None.
  • Pushes: None.