Class Cursor

Allows you to manipulate the platform cursor in various ways.

Thread safe.

Constructors

Accessors

  • get isCursorHidden(): boolean
  • Determines if the cursor is hidden.

    Returns boolean

Methods

  • Removes a custom cursor icon and releases any data associated with it.

    Parameters

    • name: string

    Returns any

  • Removes a custom cursor icon and releases any data associated with it. Restores original icon associated with this cursor type.

    Parameters

    Returns any

  • Disables cursor clipping that was set using any of the clipTo* methods.

    Returns void

  • Limit cursor movement to specific area on the screen.

    Parameters

    Returns void

  • Hides the cursor.

    Returns void

  • Clips the cursor in place such that it can't move at all from its current location. Can be disabled by calling unlock.

    Returns void

  • Sets a cursor icon. Uses one of the built-in cursor types.

    Parameters

    Returns any

  • Sets a cursor icon. Uses one of the manually registered icons.

    Parameters

    • name: string

      The name to identify the cursor, one set previously by calling setCursorIcon().

    Returns any

  • Registers a new custom cursor icon you can then set by calling "setCursor".

    Parameters

    • name: string

      The name to identify the cursor.

    • pixelData: PixelData

      Cursor image data.

    • hotSpot: Immutable<Vector2>

      Offset on the cursor image to where the actual input happens (for example tip of the Arrow cursor).

    Returns any

    Stores an internal copy of the pixel data. Clear it by calling removeCursorIcon(). If a custom icon with the same name already exists it will be replaced.

  • Registers a new custom cursor icon you can then set by calling setCursor().

    Parameters

    • type: EnumValue<CursorType, number>

      One of the built-in cursor types.

    • pixelData: PixelData

      Cursor image data.

    • hotSpot: Immutable<Vector2>

      Offset on the cursor image to where the actual input happens (for example tip of the Arrow cursor).

    Returns any

    Stores an internal copy of the pixel data. Clear it by calling removeCursorIcon(). If a custom icon with the same type already exists it will be replaced.

  • Shows the cursor.

    Returns void

  • Unlocks the cursor to be able to be moved again after a call to lock.

    Returns void