mirror of
https://github.com/Insality/druid
synced 2025-06-27 02:17:52 +02:00
3.2 KiB
3.2 KiB
druid.drag API
at /druid/base/drag.lua
Functions
- init
- on_style_change
- set_drag_cursors
- on_late_init
- on_window_resized
- on_input_interrupt
- on_input
- set_click_zone
- set_enabled
- is_enabled
Fields
- node
- on_touch_start
- on_touch_end
- on_drag_start
- on_drag
- on_drag_end
- style
- click_zone
- is_touch
- is_drag
- can_x
- can_y
- dx
- dy
- touch_id
- (#x)
- y
- screen_x
- screen_y
- touch_start_pos
- druid
- hover
init
drag:init(node_or_node_id, on_drag_callback)
- Parameters:
node_or_node_id
(string|node):on_drag_callback
(function):
on_style_change
drag:on_style_change(style)
- Parameters:
style
(druid.drag.style):
set_drag_cursors
drag:set_drag_cursors(is_enabled)
Set Drag component enabled state.
- Parameters:
is_enabled
(boolean):
on_late_init
drag:on_late_init()
on_window_resized
drag:on_window_resized()
on_input_interrupt
drag:on_input_interrupt()
on_input
drag:on_input(action_id, action)
-
Parameters:
action_id
(hash):action
(table):
-
Returns:
- `` (boolean):
set_click_zone
drag:set_click_zone([node])
Set Drag click zone
-
Parameters:
[node]
(string|node|nil):
-
Returns:
self
(druid.drag): Current instance
set_enabled
drag:set_enabled(is_enabled)
Set Drag component enabled state.
-
Parameters:
is_enabled
(boolean):
-
Returns:
self
(druid.drag): Current instance
is_enabled
drag:is_enabled()
Check if Drag component is capture input
- Returns:
- `` (boolean):
Fields
- node (node)
- on_touch_start (event)
- on_touch_end (event)
- on_drag_start (event)
- on_drag (event)
- on_drag_end (event)
- style (druid.drag.style)
- click_zone (node)
- is_touch (boolean)
- is_drag (boolean)
- can_x (boolean)
- can_y (boolean)
- dx (number)
- dy (number)
- touch_id (number)
- x (number)
- y (number)
- screen_x (number)
- screen_y (number)
- touch_start_pos (vector3)
- druid (druid.instance)
- hover (druid.hover)