mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 10:27:47 +02:00
Rename back hold_click -> hold_callback
This commit is contained in:
parent
959f367dd7
commit
696622b42b
@ -13,7 +13,7 @@ Basic Druid input component
|
|||||||
- **on_click** - basic button callback
|
- **on_click** - basic button callback
|
||||||
- **on_repeated_click** - repeated click callback, while holding the button, don't trigger if callback is empty
|
- **on_repeated_click** - repeated click callback, while holding the button, don't trigger if callback is empty
|
||||||
- **on_long_click** - callback on long button tap, don't trigger if callback is empty
|
- **on_long_click** - callback on long button tap, don't trigger if callback is empty
|
||||||
- **on_hold_click** - hold callback, before long_click trigger, don't trigger if callback is empty
|
- **on_hold_callback** - hold callback, before long_click trigger, don't trigger if callback is empty
|
||||||
- **on_double_click** - different callback, if tap button 2+ in row, don't trigger if callback is empty
|
- **on_double_click** - different callback, if tap button 2+ in row, don't trigger if callback is empty
|
||||||
- If you have stencil on buttons and you don't want trigger them outside of stencil node, you can use `button:set_click_zone` to restrict button click zone
|
- If you have stencil on buttons and you don't want trigger them outside of stencil node, you can use `button:set_click_zone` to restrict button click zone
|
||||||
- Button can have key trigger to use then by key: `button:set_key_trigger`
|
- Button can have key trigger to use then by key: `button:set_key_trigger`
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
-- @tfield druid_event on_repeated_click On repeated action button callback
|
-- @tfield druid_event on_repeated_click On repeated action button callback
|
||||||
-- @tfield druid_event on_long_click On long tap button callback
|
-- @tfield druid_event on_long_click On long tap button callback
|
||||||
-- @tfield druid_event on_double_click On double tap button callback
|
-- @tfield druid_event on_double_click On double tap button callback
|
||||||
-- @tfield druid_event on_hold_click On button hold before long_click callback
|
-- @tfield druid_event on_hold_callback On button hold before long_click callback
|
||||||
|
|
||||||
--- Component fields
|
--- Component fields
|
||||||
-- @table Fields
|
-- @table Fields
|
||||||
@ -100,7 +100,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
local function on_button_hold(self, press_time)
|
local function on_button_hold(self, press_time)
|
||||||
self.on_hold_click:trigger(self:get_context(), self.params, self, press_time)
|
self.on_hold_callback:trigger(self:get_context(), self.params, self, press_time)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -168,7 +168,7 @@ function M.init(self, node, callback, params, anim_node, event)
|
|||||||
self.on_repeated_click = Event()
|
self.on_repeated_click = Event()
|
||||||
self.on_long_click = Event()
|
self.on_long_click = Event()
|
||||||
self.on_double_click = Event()
|
self.on_double_click = Event()
|
||||||
self.on_hold_click = Event()
|
self.on_hold_callback = Event()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user