Module Swipe
Component to handle swipe gestures on node.
Swipe will be triggered, if swipe was started and
ended on one node
Example Link
style |
Component style params. |
click_zone |
Restriction zone |
node |
Swipe node |
on_swipe |
Trigger on swipe event(self, swipe_side, dist, delta_time) |
-
init(self, node, on_swipe_callback)
-
The Swipe constructor
Parameters:
- self
Swipe
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:
-
style
-
Component style params.
You can override this component styles params in druid styles table
or create your own style
Fields:
- SWIPE_TIME
number or nil
Maximum time for swipe trigger. Default: 0.4
- SWIPE_THRESHOLD
number or nil
Minimum distance for swipe trigger. Default: 50
- SWIPE_TRIGGER_ON_MOVE
boolean or nil
If true, trigger on swipe moving, not only release action. Default: false
-
click_zone
-
Restriction zone
-
node
-
Swipe node
-
on_swipe
-
Trigger on swipe event(self, swipe_side, dist, delta_time)