Skip to content

Profectus / game/boards/board / DraggableNodeOptions

Interface: DraggableNodeOptions<T> ​

An object that configures a DraggableNode.

Type Parameters ​

• T

Properties ​

board ​

board: Ref<any, any>

A ref to the specific instance of the Board vue component the node will be draggable on. Obtained by passing a suitable ref as the "ref" attribute to the Board component.

Defined in ​

profectus/src/game/boards/board.tsx:55


dropAreaRadius? ​

optional dropAreaRadius: NodeMaybeRefOrGetter<T, number, []>

The maximum distance (in pixels, before zoom) away a node can be and still drop onto a receiving node.

Defined in ​

profectus/src/game/boards/board.tsx:63


getPosition() ​

getPosition: (node) => NodePosition

Getter function to go from the node (typically ID) to the position of said node.

Parameters ​

node ​

T

Returns ​

NodePosition

Defined in ​

profectus/src/game/boards/board.tsx:57


onDrop()? ​

optional onDrop: (acceptingNode, draggingNode) => void

A callback for when a node gets dropped upon a receiving node.

Parameters ​

acceptingNode ​

T

draggingNode ​

T

Returns ​

void

Defined in ​

profectus/src/game/boards/board.tsx:65


receivingNodes? ​

optional receivingNodes: NodeMaybeRefOrGetter<T, T[], []>

A list of nodes that the currently dragged node can be dropped upon.

Defined in ​

profectus/src/game/boards/board.tsx:61


setPosition() ​

setPosition: (node, position) => void

Setter function to update the position of a node.

Parameters ​

node ​

T

position ​

NodePosition

Returns ​

void

Defined in ​

profectus/src/game/boards/board.tsx:59