Profectus / game/boards/board / Draggable
Interface: Draggable<T> ​
Contains all the data tied to making a vue feature draggable
Extends ​
Type Parameters ​
• T
Properties ​
computedPosition ​
computedPosition:
ComputedRef
<NodePosition
>
The current position, plus the current offset from being dragged.
Defined in ​
profectus/src/game/boards/board.tsx:263
dragDelta ​
dragDelta:
Ref
<NodePosition
,NodePosition
>
A reference to how far the node being dragged is from its initial position. Typically from setupDraggableNode.
Inherited from ​
MakeDraggableOptions
.dragDelta
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.
Inherited from ​
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.
Inherited from ​
MakeDraggableOptions
.hasDragged
Defined in ​
profectus/src/game/boards/board.tsx:243
id ​
id:
T
The node ID to use for the vue feature.
Inherited from ​
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).
Inherited from ​
MakeDraggableOptions
.initialPosition
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.
Inherited from ​
MakeDraggableOptions
.nodeBeingDragged
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 ​
Returns ​
boolean
| void
Inherited from ​
MakeDraggableOptions
.onMouseDown
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 ​
Returns ​
boolean
| void
Inherited from ​
MakeDraggableOptions
.onMouseUp
Defined in ​
profectus/src/game/boards/board.tsx:253
position ​
position:
Persistent
<NodePosition
>
The current position of the node on the board.
Defined in ​
profectus/src/game/boards/board.tsx:261
startDrag() ​
startDrag: (
e
,id
) =>void
A function to call when a drag is supposed to start. Typically from setupDraggableNode.
Parameters ​
e ​
id ​
T
Returns ​
void
Inherited from ​
MakeDraggableOptions
.startDrag