Skip to content

Latest commit

 

History

History
61 lines (37 loc) · 903 Bytes

File metadata and controls

61 lines (37 loc) · 903 Bytes

druid.swipe API

位于 /druid/extended/swipe.lua

用于管理节点上滑动事件的组件

函数

字段

init


swipe:init(node_or_node_id, on_swipe_callback)
  • 参数:
    • node_or_node_id (string|node): 节点或节点ID
    • on_swipe_callback (function): 滑动回调函数

set_click_zone


swipe:set_click_zone([zone])

设置滑动的点击区域,对于限制模板节点外的事件很有用。

  • 参数:
    • [zone] (string|node|nil): GUI 节点

事件字段

node

用于管理滑动的节点。

on_swipe

检测到滑动时触发的事件。 函数签名:fun(context, side, dist, dt)

style

滑动组件样式配置。

click_zone

点击区域节点。