DropTarget
class DropTarget extends Renderable
a base drop target object
Constructor
new DropTarget(x: number, y: number, width: number, height: number) → {}
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 from DropTarget
string |
|
string |
|
string |
|
Methods from DropTarget
Properties inherited from Renderable
number |
|
boolean |
|
Container | Entity |
|
ObservableVector2d |
|
boolean |
|
string |
|
Body |
|
Matrix2d |
|
number |
|
boolean |
|
string |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
Rect | RoundRect | Polygon | Line | Ellipse |
|
string |
|
Function |
|
Application |
|
ObservableVector3d |
|
GLShader |
|
Color |
|
boolean |
|
Properties inherited from Rect
Methods inherited from Renderable
Methods inherited from Rect
Rect |
|
Rect |
|
boolean |
|
Rect |
|
boolean |
|
boolean |
|
boolean |
|
Rect |
|
Rect |
|
Polygon |
|
Rect |
|
Methods inherited from Polygon
Array<number> |
|
boolean |
|
Polygon |
|
Polygon |
|
|
|
Polygon |
|
Polygon |
|
Polygon |
|
Public Properties
CHECKMETHOD_CONTAINS: string = "contains"
string
constant for the contains method
CHECKMETHOD_OVERLAP: string = "overlaps"
string
constant for the overlaps method
Public Methods
checkOnMe(e: object, draggable: Draggable) → {}
Checks if a dropped entity is dropped on the current entity
Name | Type | Description |
---|---|---|
e | object |
the triggering event |
draggable | Draggable |
the draggable object that is dropped |
drop(draggable: Draggable) → {}
Gets called when a draggable entity is dropped on the current entity
Name | Type | Description |
---|---|---|
draggable | Draggable |
the draggable object that is dropped |
setCheckMethod(checkMethod: string) → {}
Sets the collision method which is going to be used to check a valid drop
Name | Type | Description |
---|---|---|
checkMethod | string |
the checkmethod (defaults to CHECKMETHOD_OVERLAP) |