2025-04-15 21:49:22 +03:00

1016 B

druid.swipe API

at /druid/extended/swipe.lua

The component to manage swipe events over a node

Functions

Fields

init


swipe:init(node_or_node_id, on_swipe_callback)
  • Parameters:
    • node_or_node_id (string|node):
    • on_swipe_callback (function):

set_click_zone


swipe:set_click_zone([zone])

Set the click zone for the swipe, useful for restricting events outside stencil node

  • Parameters:
    • [zone] (string|node|nil): Gui node

Fields

  • node (node): The node to manage the swipe

  • on_swipe (event): fun(context, side, dist, dt) The event triggered when a swipe is detected

  • style (druid.swipe.style): The style of the swipe

  • click_zone (node): The click zone of the swipe