跳到主要内容

Cursor Menu

The BetterHud Cursor Menu entry displays a visual menu where the player controls a cursor by looking around (pitch/yaw). This allows for free-form layouts that mimic a mouse-driven interface without actual mouse capture.

interactions

  1. Cursor Control: Player gaze controls the cursor. Looking right/left moves X, up/down moves Y.
  2. Detection: The cursor hits buttons defined by X/Y/Width/Height.
  3. Click: Pressing the confirmation key (default: Shift/Drop) clicks the button.

Configuration

This entry requires a corresponding BetterHud configuration (Image/Layout/Popup) to render the visuals. The extension provides cursor_x and cursor_y variables (0-100) to position the cursor image dynamically.

popupIdString

The ID of the BetterHud popup to display.

buttons

"> Definitions of interactable buttons.

cursorSensitivityDouble

Multiplier for cursor movement speed relative to head movement.

yawRangeDouble

Degrees of horizontal rotation for full screen width.

pitchRangeDouble

Degrees of vertical rotation for full screen height.

showCursorBoolean

Whether to calculate/show the cursor (true by default).

textString

Optional title text to display.

Button Definition

buttonIdString

Unique ID for the button.

xDouble

Center X position (0-100%).

yDouble

Center Y position (0-100%).

widthDouble

Size of the hit area width (percentage).

heightDouble

Size of the hit area height (percentage).

textString

Display text for the button.

triggers

"> Actions to run when clicked.

BetterHud Setup

You must create valid BetterHud images, layouts, and popups that respond to the variables:

  • [cursor_x], [cursor_y]
  • [hovered_button] (ID of hovered button)
  • [button_ID_hovered] (1 if true, 0 if false)
cursor_layout:
images:
1:
name: cursor_icon
gui:
x: "[cursor_x]"
y: "[cursor_y]"
conditions:
- condition: "[hovered_button] != ''"
image: cursor_hover_icon