DropTarget

class DropTarget extends Renderable

a base drop target object

See: Draggable

Constructor


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

the x coordinates of the drop target

y number

the y coordinates of the drop target

width number

drop target width

height number

drop target height

Summary


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 Properties


checkMethod dragndrop.js:43
checkMethod: string = "overlaps"

string

the checkmethod we want to use

CHECKMETHOD_CONTAINS dragndrop.js:33
CHECKMETHOD_CONTAINS: string = "contains"

string

constant for the contains method

CHECKMETHOD_OVERLAP dragndrop.js:23
CHECKMETHOD_OVERLAP: string = "overlaps"

string

constant for the overlaps method

Public Methods


checkOnMe dragndrop.js:72
checkOnMe(e: object, draggable: Draggable) → {}

Checks if a dropped entity is dropped on the current entity

Parameters:
Name Type Description
e object

the triggering event

draggable Draggable

the draggable object that is dropped

drop dragndrop.js:86
drop(draggable: Draggable) → {}

Gets called when a draggable entity is dropped on the current entity

Parameters:
Name Type Description
draggable Draggable

the draggable object that is dropped

setCheckMethod dragndrop.js:58
setCheckMethod(checkMethod: string) → {}

Sets the collision method which is going to be used to check a valid drop

Parameters:
Name Type Description
checkMethod string

the checkmethod (defaults to CHECKMETHOD_OVERLAP)


Powered by webdoc!