Reticle

Description

Supported Script Types:

  • Interface Scripts
  • Client Entity Scripts
  • Avatar Scripts
The Reticle API provides access to the mouse cursor. The cursor may be an arrow or a reticle circle, depending on Interface settings. The mouse cursor is visible in HMD mode if controllers aren't being used.

Properties

Name Type Summary
allowMouseCapture boolean

true if the mouse cursor will be captured when in HMD mode and the Interface window content (excluding menus) has focus, false if the mouse cursor will not be captured.

Default Value: true

depth number

The depth (distance) that the reticle is displayed at relative to the HMD view, in HMD mode.

maximumPosition Vec2

The maximum reticle coordinates on the display device in desktop mode or the HUD surface in HMD mode. (The minimum reticle coordinates on the desktop display device or HUD surface are 0, 0.) Read-only.

mouseCaptured boolean

true if the mouse cursor is captured, displaying only in Interface and not on the rest of the desktop. The mouse cursor may be captured when in HMD mode and the Interface window content (excluding menu items) has focus, if capturing is enabled (allowMouseCapture is true). Read-only.

pointingAtSystemOverlay boolean

true if the mouse cursor is pointing at UI in the Interface window in desktop mode or on the HUD surface in HMD mode, false if it isn't. Read-only.

position Vec2

The position of the cursor. This is the position relative to the Interface window in desktop mode, and the HUD surface in HMD mode.

Note: The position values may be negative.

scale number

The scale of the reticle circle in desktop mode, and the arrow and reticle circle in HMD mode. (Does not affect the size of the arrow in desktop mode.)

Default Value: 1

visible boolean

true if the reticle circle is visible in desktop mode, and the arrow or reticle circle are visible in HMD mode; false otherwise. (Does not affect the visibility of the mouse pointer in desktop mode.)

Default Value: true

Methods

Name Return Value Summary
getAllowMouseCapture boolean

Gets whether the mouse cursor will be captured when in HMD mode and the Interface window content (excluding menu items) has focus. When captured, the mouse cursor displays only in Interface, not on the rest of the desktop.

getDepth number

Gets the depth (distance) that the reticle is displayed at relative to the HMD view, in HMD mode.

getMaximumPosition Vec2

Gets the maximum reticle coordinates on the display device in desktop mode or the HUD surface in HMD mode. (The minimum reticle coordinates on the desktop display device or HUD surface are 0, 0.)

getPosition Vec2

Gets the position of the cursor. This is the position relative to the Interface window in desktop mode, and the HUD surface in HMD mode.

Note: The position values may be negative.

getScale number

Gets the scale of the reticle circle in desktop mode, and the arrow and reticle circle in HMD mode. (Does not affect the size of the arrow in desktop mode.) The default scale is 1.0.

getVisible boolean

Gets whether the reticle circle is visible in desktop mode, or the arrow or reticle circle are visible in HMD mode.

isMouseCaptured boolean

Checks whether the mouse cursor is captured, displaying only in Interface and not on the rest of the desktop. The mouse cursor is captured when in HMD mode and the Interface window content (excluding menu items) has focus, if capturing is enabled (allowMouseCapture property value is true).

isPointingAtSystemOverlay boolean

Gets whether the mouse cursor is pointing at UI in the Interface window in desktop mode or on the HUD surface in HMD mode.

setAllowMouseCapture None

Sets whether the mouse cursor will be captured when in HMD mode and the Interface window content (excluding menu items) has focus. When captured, the mouse cursor displays only in Interface, not on the rest of desktop.

setDepth None

Sets the depth (distance) that the reticle is displayed at relative to the HMD view, in HMD mode.

setPosition None

Sets the position of the cursor. This is the position relative to the Interface window in desktop mode, and the HUD surface in HMD mode.

Note: The position values may be negative.

setScale None

Sets the scale of the reticle circle in desktop mode, and the arrow and reticle circle in HMD mode. (Does not affect the size of the arrow in desktop mode.) The default scale is 1.0.

setVisible None

Sets whether the reticle circle is visible in desktop mode, or the arrow or reticle circle are visible in HMD mode.

Method Details

(static) getAllowMouseCapture( ) → {boolean}
Returns: true if the mouse cursor will be captured when in HMD mode and the Interface window content has focus, false if the mouse cursor will not be captured.

Gets whether the mouse cursor will be captured when in HMD mode and the Interface window content (excluding menu items) has focus. When captured, the mouse cursor displays only in Interface, not on the rest of the desktop.

(static) getDepth( ) → {number}
Returns: The depth (distance) that the reticle is displayed at relative to the HMD view, in HMD mode.

Gets the depth (distance) that the reticle is displayed at relative to the HMD view, in HMD mode.

(static) getMaximumPosition( ) → {Vec2}
Returns: The maximum reticle coordinates on the display device in desktop mode or the HUD surface in HMD mode.

Gets the maximum reticle coordinates on the display device in desktop mode or the HUD surface in HMD mode. (The minimum reticle coordinates on the desktop display device or HUD surface are 0, 0.)

(static) getPosition( ) → {Vec2}
Returns: The position of the cursor.

Gets the position of the cursor. This is the position relative to the Interface window in desktop mode, and the HUD surface in HMD mode.

Note: The position values may be negative.

(static) getScale( ) → {number}
Returns: The scale of the reticle.

Gets the scale of the reticle circle in desktop mode, and the arrow and reticle circle in HMD mode. (Does not affect the size of the arrow in desktop mode.) The default scale is 1.0.

(static) getVisible( ) → {boolean}
Returns: true if the reticle circle is visible in desktop mode, and the arrow or reticle circle are visible in HMD mode; false otherwise. (The mouse pointer is always visible in desktop mode.)

Gets whether the reticle circle is visible in desktop mode, or the arrow or reticle circle are visible in HMD mode.

(static) isMouseCaptured( ) → {boolean}
Returns: true if the mouse cursor is captured, displaying only in Interface and not on the desktop.

Checks whether the mouse cursor is captured, displaying only in Interface and not on the rest of the desktop. The mouse cursor is captured when in HMD mode and the Interface window content (excluding menu items) has focus, if capturing is enabled (allowMouseCapture property value is true).

(static) isPointingAtSystemOverlay( ) → {boolean}
Returns: true if the mouse cursor is pointing at UI in the Interface window in desktop mode or on the HUD surface in HMD mode, false if it isn't.

Gets whether the mouse cursor is pointing at UI in the Interface window in desktop mode or on the HUD surface in HMD mode.

(static) setAllowMouseCapture( allowMouseCaptured )

Sets whether the mouse cursor will be captured when in HMD mode and the Interface window content (excluding menu items) has focus. When captured, the mouse cursor displays only in Interface, not on the rest of desktop.

Parameters

Name Type Description
allowMouseCaptured boolean

true if the mouse cursor will be captured when in HMD mode and the Interface window content has focus, false if the mouse cursor will not be captured.

(static) setDepth( depth )

Sets the depth (distance) that the reticle is displayed at relative to the HMD view, in HMD mode.

Parameters

Name Type Description
depth number

The depth (distance) that the reticle is displayed at relative to the HMD view, in HMD mode.

(static) setPosition( position )

Sets the position of the cursor. This is the position relative to the Interface window in desktop mode, and the HUD surface in HMD mode.

Note: The position values may be negative.

Parameters

Name Type Description
position Vec2

The position of the cursor.

(static) setScale( scale )

Sets the scale of the reticle circle in desktop mode, and the arrow and reticle circle in HMD mode. (Does not affect the size of the arrow in desktop mode.) The default scale is 1.0.

Parameters

Name Type Description
scale number

The scale of the reticle.

(static) setVisible( visible )

Sets whether the reticle circle is visible in desktop mode, or the arrow or reticle circle are visible in HMD mode.

Parameters

Name Type Description
visible boolean

true if the reticle circle is visible in desktop mode, and the arrow or reticle circle are visible in HMD mode; false otherwise. (Does not affect the visibility of the mouse pointer in desktop mode.)