Draggable

class Draggable extends Renderable

A Draggable base object

See: DropTarget

Constructor


new Draggable(x: number, y: number, width: number, height: number) → {}
Parameters:
Name Type Description
x number

the x coordinates of the draggable object

y number

the y coordinates of the draggable object

width number

draggable object width

height number

draggable object height

Summary


Methods from Draggable

Properties inherited from Rect

number
bottom
number
centerX
number
centerY
number
height
number
left
number
right
number
top
string
type = "Rectangle"
number
width

Properties inherited from Polygon

Array<Vector2d>
points

Public Methods


dragEnd draggable.js:84
dragEnd() → {boolean}

Gets called when the user stops dragging the entity

Returns:
Type Description
boolean

false if the object stopped being dragged

dragMove draggable.js:71
dragMove(e: object) → {}

Gets called when the user drags this entity around

Parameters:
Name Type Description
e object

the pointer event

dragStart draggable.js:55
dragStart(e: object) → {boolean}

Gets called when the user starts dragging the entity

Parameters:
Name Type Description
e object

the pointer event

Returns:
Type Description
boolean

false if the object is being dragged


Powered by webdoc!