where the panel actually sits, after edge clamping - the value a layout test reads
the text currently shown, or waiting out its delay; null when nothing is hovered
The pointer is resting on something with text to explain, at x/y.
Safe to call every frame with the same arguments: the delay keeps counting rather than restarting. Calling it with different text restarts the wait, so sweeping across a row of icons shows the one the pointer settles on rather than the first one it crossed.
the pointer left: cancels a pending tooltip and hides a shown one
ProtectedmeasureHow big the wrapped text is, which decides the panel's size.
Its own method purely so it can be overridden: Pixi measures text through a canvas, so
reading a Label's width needs a DOM and nothing here can size itself under
node --test. A test subclasses this and returns a fixed size, which leaves the parts
actually worth testing (the hover delay, the edge flip, the clamp) fully exercised - the
same subclass seam StageScript's tests already use in place of stubbing Pixi.
call from the owning scene's resize, so edge clamping knows what it is clamping to
true on the frame the tooltip becomes visible, for a game that wants to cue a sound
The hover explanation every dense interface needs: what this item does, what this stat means, why this button is disabled.
The delay is counted in
update(dt)rather than asetTimeout, the same choiceIconGridalready made for long-press andWindowStackfor its own timing: a frame-driven counter is exactly as testable as it is correct, and it cannot fire after the scene that owned it has gone away. The panel itself is a non-modalWindow, so a tooltip inherits the theme's frame, padding and live restyling rather than drawing a second kind of panel that would drift from every other one the moment a game setstheme.panel.Positioning is the other half: a tooltip near the right or bottom edge flips back inside the viewport instead of being cut off, which is why
setViewporthas to be called from the owning scene's ownresize.Example