Table of Contents

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

bool

IsToolTipRegistered

True if a tooltip has been registered for the current frame.

bool IsToolTipRegistered { get; }

Property Value

bool

ScreenPos

Cursor position in screen-space pixels

Vector2 ScreenPos { get; }

Property Value

Vector2

Visible

True if the cursor is currently visible (not hidden by game UI or capture state).

bool Visible { get; }

Property Value

bool

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

LineD

WorldPos

Cursor position in world space

Vector3D WorldPos { get; }

Property Value

Vector3D

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

capturedElement Func<object, int, object>

Returns

bool

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

GetHudSpaceFunc Func<MyTuple<bool, float, MatrixD>>

Delegate that returns (bool isValid, float depthSquared, MatrixD worldMatrix) for the HUD space node.

Returns

bool

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

toolTip ToolTip

The ToolTip instance to display.

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

capturedElement Func<object, int, object>

Returns

bool

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

depthSquared float

Squared distance from camera to the plane/node. Smaller = closer.

GetHudSpaceFunc Func<MyTuple<bool, float, MatrixD>>

Delegate returning plane validity, depth, and world matrix.

Returns

bool

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)

Parameters

capturedElement Func<object, int, object>

Returns

bool