Skip to content

Pointer

Client-only

The Pointer library offers methods and events related to the state of the pointer - that is, what the user is selecting with their cursor. This includes world objects as well as drag-drop.

It's primarily a wrapper around Ext.UI.GetPickingState(). In addition to methods to quickly fetch its entities, it offers events for when they change (when the user starts/stops hovering over a new entity).

PointerLib Class

Inherits from Library.

Events and Hooks

HoverCharacterChanged (event)

@field Character EclCharacter?

HoverCharacter2Changed (event)

Fired when the corpse character over the pointer changes.

@field Character EclCharacter?

HoverItemChanged (event)

@field Item EclItem?

HoverEntityChanged (event)

@field Entity Entity?

DragDropStateChanged (event)

Fired when a player starts or ends a drag drop.

@field State DragDropManagerPlayerDragInfo? `nil` if the player stopped dragging.

@field PlayerIndex integer

UIDragStarted (event)

@field UI UIObject

UIDragEnded (event)

@field UI UIObject

Methods

GetCurrentCharacter
function PointerLib.GetCurrentCharacter(playerIndex, includeDead) -- (Client-only)
   -> EclCharacter?

@param playerIndex integer? Defaults to 1.

@param includeDead boolean? Defaults to false.

GetCurrentEntity
function PointerLib.GetCurrentEntity(playerIndex) -- (Client-only)
   -> Entity?

@param playerIndex integer? Defaults to 1.

GetCurrentItem
function PointerLib.GetCurrentItem(playerIndex) -- (Client-only)
   -> EclItem?

@param playerIndex integer? Defaults to 1.

GetDragDropState
function PointerLib.GetDragDropState(playerIndex) -- (Client-only)
   -> DragDropManagerPlayerDragInfo

Returns the drag-drop system state for a player.

@param playerIndex integer? Defaults to 1.

GetDraggedItem
function PointerLib.GetDraggedItem(playerIndex) -- (Client-only)
   -> EclItem?

Returns the item being dragged by a player.

@param playerIndex integer? Defaults to 1.

GetDraggedSkill
function PointerLib.GetDraggedSkill(playerIndex) -- (Client-only)
   -> string? -- Can be an action as well.

Returns the skill being dragged by a player.

@param playerIndex integer? Defaults to 1.

GetWalkablePosition
function PointerLib.GetWalkablePosition(playerIndex) -- (Client-only)
   -> Vector3D

@param playerIndex integer? Defaults to 1.

GetWorldPosition
function PointerLib.GetWorldPosition(playerIndex) -- (Client-only)
   -> Vector3D

@param playerIndex integer? Defaults to 1.

IsDragging
function PointerLib.IsDragging(playerIndex) -- (Client-only)
   -> boolean

Returns whether the player's cursor is dragging anything.

@param playerIndex integer? Defaults to 1.

StopDragging
function PointerLib.StopDragging(playerIndex) -- (Client-only)

Stops a drag-drop.

@param playerIndex integer? Defaults to `1`.