Skip to content

DragSession

Defined in: src/modules/drag-drop/drag-drop.ts:8

The state of one drag, from press to drop. All points are in the space the consumer passes to DragDrop — client pixels, canvas pixels or world units; the session never converts.

TPayload

readonly grab: Vec2

Defined in: src/modules/drag-drop/drag-drop.ts:10

Pointer minus the dragged item’s origin at the press: where on the item it was grabbed.


readonly payload: TPayload

Defined in: src/modules/drag-drop/drag-drop.ts:12

What is being dragged — an entity id, a list of cards, an inventory slot.


readonly pointer: Vec2

Defined in: src/modules/drag-drop/drag-drop.ts:14

The latest pointer.


readonly position: Vec2

Defined in: src/modules/drag-drop/drag-drop.ts:16

Where to draw the dragged item’s origin now: pointer − grab.


readonly press: Vec2

Defined in: src/modules/drag-drop/drag-drop.ts:18

The pointer at the press.


readonly started: boolean

Defined in: src/modules/drag-drop/drag-drop.ts:20

false until the pointer has moved threshold away from the press.