# Module `Swipe`

Component to handle swipe gestures on node.

Swipe will be triggered, if swipe was started and ended on one node

## Functions

init(self, node, on_swipe_callback) | Component init function
set_click_zone(self, zone) | Strict swipe click area.

## Tables

style | Component style params.

## Fields

node | Swipe node
click_zone | Restriction zone
on_swipe | Trigger on swipe event(self, swipe_side, dist, delta_time

## Functions

init(self, node, on_swipe_callback)
  Component init function

  ### Parameters:

  - self Swipe
  - node node Gui node
  - on_swipe_callback function Swipe callback for on_swipe_end event
set_click_zone(self, zone)
  Strict swipe click area. Useful for restrict events outside stencil node

  ### Parameters:

  - self Swipe
  - zone node Gui node

## Tables

style
  Component style params. You can override this component styles params in druid styles table or create your own style

  ### Fields:

  - SWIPE_TIME number Maximum time for swipe trigger (default 0.4)
  - SWIPE_THRESHOLD number Minimum distance for swipe trigger (default 50)
  - SWIPE_TRIGGER_ON_MOVE bool If true, trigger on swipe moving, not only release action (default false)

## Fields

node
  Swipe node
  - node node
click_zone
  Restriction zone
  - click_zone node (optional)
on_swipe
  Trigger on swipe event(self, swipe_side, dist, delta_time
  - on_swipe druid_event )

generated by LDoc 1.4.6 Last updated 2022-02-12 17:16:44