DragArea2D - Maybells/celeste-godot-utilities GitHub Wiki
Inherits: Area2D > CollisionObject2D > Node2D > CanvasItem > Node > Object
Allows the user to move the parent object by dragging with the mouse.
type | property | default value |
---|---|---|
bool | grab_centered | True |
bool | restrict_x | False |
bool | restrict_y | False |
bool | dragging | False |
Vector2 | drag_offset | Null |
return type | method signature |
---|---|
null | pick_up() |
null | put_down() |
- picked_up()
Called when parent starts following the mouse.
- put_down()
Called when parent stops following the mouse.
- bool grab_centered
_Default_ | `True` |
---|
- bool restrict_x
_Default_ | `False` |
---|
- bool restrict_y
_Default_ | `False` |
---|
- bool dragging
Whether the object is currently being dragged
- Vector2 drag_offset
The initial mouse position relative to the dragged object
- void pick_up()
Makes the parent start following the mouse.
- void put_down()
Makes the parent stop following the mouse.