class UIDraggable
A draggable ui-panel.
class UIDraggable extends UIPanel
Inheritance UIElement –> UIBlock –> UIPanel –> UIDraggable
| Name | Description |
|---|---|
| Constructors | |
| UIDraggable() | Creates a new UIDraggable. |
| Properties | |
| draggableHorizontal | If the panel is draggable in horizontal direction. |
| draggableVertical | If the panel is draggable in vertical direction. |
| originMin | Minimum position for origin. |
| originMax | Maximum position for origin. |
| value | Value corresponding to current position. |
| onDrag | Callback functions called when the element is dragged. |
| Methods | |
| getOriginMin() | Get the value of .originMin |
| setOriginMin() | Set the value of .originMin |
| getOriginMax() | Get the value of .originMax |
| setOriginMax() | Set the value of .originMax |
| getValue() | Get the value of .value |
| setValue() | Set the value of .value |
Constructors
UIDraggable()
UIDraggable()
Creates a new UIDraggable.
Properties
See the base UIPanel class for common properties.
draggableHorizontal
.draggableHorizontal: Boolean
Indicating if the panel is draggable in horizontal direction
Readable and writable.
Dafault is true.
draggableVertical
.draggableVertical: Boolean
Indicating if the panel is draggable in vertical direction.
Readable and writable.
Dafault is false.
originMin
.originMin: Object
A Vector2 representing the minimum position for origin.
Read-only. Use method setOriginMin() to modify this property.
Default is {x: 0, y: 0}.
originMax
.originMax: Object
A Vector2 representing the maximum position for origin.
Read-only. Use method setOriginMax() to modify this property.
Default is {x: 0, y: 0}.
value
.value: Object
A Vector2 representing the value corresponding to current position.
Read-only. Use method setValue() to modify this property.
Default is {x: 0, y: 0}.
onDrag
.onDrag: Function
.onDrag(x: Number, y: Number): undefined
Callback functions called when the element is dragged.
Methods
See the base UIPanel class for common methods.
getOriginMin()
.getOriginMin(vector: Vector2): Vector2
Copy the value of .originMin into vector.
setOriginMin()
.setOriginMin(vector: Vector2): undefined
Set the value of .originMin according to vector.
.setOriginMin(x: Number, y: Number ): undefined
Set the value of .originMin according to the x, y coordinates.
getOriginMax()
.getOriginMax(vector: Vector2): Vector2
Copy the value of .originMax into vector.
setOriginMax()
.setOriginMax(vector: Vector2): undefined
Set the value of .originMax according to vector.
.setOriginMax(x: Number, y: Number ): undefined
Set the value of .originMax according to the x, y coordinates.
getValue()
.getValue(vector: Vector2): Vector2
Copy the value of .value into vector.
setValue()
.setValue(vector: Vector2): undefined
Set the value of .value according to vector.
.setValue(x: Number, y: Number ): undefined
Set the value of .value according to the x, y coordinates.