new UIButtonDraggable( [parent] [, key] [, labelText])
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
parent |
PhaserComps.UIComponents.UIComponentPrototype |
<optional> |
UIComponentPrototype instance to find clip inside |
key |
String |
<optional> |
key to find clip inside parent |
labelText |
String |
<optional> |
text to set for a 'label' key |
Properties:
Name | Type | Description |
---|---|---|
enable |
Boolean | activate/deactivate button interaction. if false, button state is set to |
label |
String | get/set button label text |
Fires:
- event:EVENT_CLICK,
- event:EVENT_DRAG,
Extends
- UIComponents.UIButton
Methods
-
<protected> _onDrag(pointer, gameObject, dragX, dragY)
-
_dragZone
drag
event callbackParameters:
Name Type Description pointer
gameObject
Phaser.GameObjects.GameObject dragX
Number dragY
Number -
<protected> _onDragStart(pointer, gameObject)
-
_dragZone
dragstart
event callbackParameters:
Name Type Description pointer
gameObject
Phaser.GameObjects.GameObject -
setDragBounds(minX, minY, maxX, maxY)
-
Set clip drag bounds
Parameters:
Name Type Description minX
Number left drag bound
minY
Number top drag bound
maxX
Number right drag bound
maxY
Number bottom drag bound
Type Definitions
-
DragBounds
-
Properties:
Name Type Description minX
Number left drag bound
minY
Number top drag bound
maxX
Number right drag bound
maxY
Number bottom drag bound
Events
-
EVENT_DRAG
-
Emitted on drag move.
Parameters:
Name Type Description x
Number horizontal drag movement (from drag start)
y
Number vertical drag movement (from drag start)