Interface ICursor
- Namespace
- RichHudFramework.UI
- Assembly
- RichHudClient.dll
Represents the global mouse cursor managed by Rich HUD Framework. Provides screen/world position, capture state, and tooltip registration functionality. Used by all clickable UI elements for correct hit-testing and interaction within and between HUD spaces.
public interface ICursor
Properties
IsCaptured
True if any UI element is currently capturing the cursor
bool IsCaptured { get; }
Property Value
IsToolTipRegistered
True if a tooltip has been registered for the current frame.
bool IsToolTipRegistered { get; }
Property Value
ScreenPos
Cursor position in screen-space pixels
Vector2 ScreenPos { get; }
Property Value
Visible
True if the cursor is currently visible (not hidden by game UI or capture state).
bool Visible { get; }
Property Value
WorldLine
Unwarped line starting at the camera and passing through the cursor position. Corrects for perspective distortion so that a straight line in world space remains straight on screen.
LineD WorldLine { get; }
Property Value
WorldPos
Cursor position in world space
Vector3D WorldPos { get; }
Property Value
Methods
IsCapturing(Func<object, int, object>)
Returns true if the cursor is currently captured by the given API-wrapped element.
bool IsCapturing(Func<object, int, object> capturedElement)
Parameters
Returns
IsCapturingSpace(Func<MyTuple<bool, float, MatrixD>>)
Determines whether the cursor is currently being drawn in (and captured by) the given HUD space.
bool IsCapturingSpace(Func<MyTuple<bool, float, MatrixD>> GetHudSpaceFunc)
Parameters
GetHudSpaceFuncFunc<MyTuple<bool, float, MatrixD>>Delegate that returns (bool isValid, float depthSquared, MatrixD worldMatrix) for the HUD space node.
Returns
RegisterToolTip(ToolTip)
Registers a tooltip that will be displayed when the cursor is over the calling element.
Tooltips are cleared every frame — this must be called every tick inside HandleInput()
if you want a persistent tooltip.
The first registered tooltip (in registration order) wins if multiple elements try to show one.
void RegisterToolTip(ToolTip toolTip)
Parameters
TryCapture(Func<object, int, object>)
Attempts to capture the cursor capture using a standard API-wrapped element. Returns true on success. Usually succeeds unless already captured by a higher-priority element.
bool TryCapture(Func<object, int, object> capturedElement)
Parameters
Returns
TryCaptureHudSpace(float, Func<MyTuple<bool, float, MatrixD>>)
Attempts to capture the cursor for a custom 3D HUD space at the specified depth. Returns true if capture succeeded (i.e., this space is closer than any existing capturer).
bool TryCaptureHudSpace(float depthSquared, Func<MyTuple<bool, float, MatrixD>> GetHudSpaceFunc)
Parameters
depthSquaredfloatSquared distance from camera to the plane/node. Smaller = closer.
GetHudSpaceFuncFunc<MyTuple<bool, float, MatrixD>>Delegate returning plane validity, depth, and world matrix.
Returns
Remarks
Only the closest (smallest depthSquared) valid plane will capture the cursor each frame.
TryRelease(Func<object, int, object>)
Attempts to release cursor capture held by the given API-wrapped element. Returns true if the element was actually holding the capture.
bool TryRelease(Func<object, int, object> capturedElement)