Skip to content

Profectus / game/boards/board / MakeDraggableOptions

Interface: MakeDraggableOptions<T> ​

An object that configures how to make a vue feature draggable using makeDraggable.

Extended by ​

Type Parameters ​

• T

Properties ​

dragDelta ​

dragDelta: Ref<NodePosition, NodePosition>

A reference to how far the node being dragged is from its initial position. Typically from setupDraggableNode.

Defined in ​

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


endDrag ​

endDrag: VoidFunction

A function to call when a drag is supposed to end. Typically from setupDraggableNode.

Defined in ​

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


hasDragged ​

hasDragged: Ref<boolean, boolean>

A reference to whether or not the node being dragged has been moved away from its initial position. Typically from setupDraggableNode.

Defined in ​

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


id ​

id: T

The node ID to use for the vue feature.

Defined in ​

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


initialPosition? ​

optional initialPosition: NodePosition

The initial position of the node on the board. Defaults to (0, 0).

Defined in ​

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


nodeBeingDragged ​

nodeBeingDragged: Ref<undefined | T, undefined | T>

A reference to the current node being dragged, typically from setupDraggableNode.

Defined in ​

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


onMouseDown()? ​

optional onMouseDown: (e) => boolean | void

A callback that's called when the element is pressed down. Fires before drag starts, and returning false will prevent the drag from happening.

Parameters ​

e ​

MouseEvent | TouchEvent

Returns ​

boolean | void

Defined in ​

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


onMouseUp()? ​

optional onMouseUp: (e) => boolean | void

A callback that's called when the mouse is lifted off the element.

Parameters ​

e ​

MouseEvent | TouchEvent

Returns ​

boolean | void

Defined in ​

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


startDrag() ​

startDrag: (e, id) => void

A function to call when a drag is supposed to start. Typically from setupDraggableNode.

Parameters ​

e ​

MouseEvent | TouchEvent

id ​

T

Returns ​

void

Defined in ​

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