Module druid.button

Component to handle basic GUI button

Functions

disable_animation(self) Disable all button animations
get_key_trigger(self) Get key-code to trigger this button
init(self, node, callback[, params[, anim_node[, event]]]) Component init function
set_callback(self, callback) Set usual button callback
set_click_zone(self, zone) Strict button click area.
set_double_tap_callback(self, callback) Get doubletap callback on this button
set_hold_callback(self, callback) Repeat callback always, while holding button
set_long_tap_callback(self, callback) Single callbacka after long_tap.

Tables

events Component events
fields Component fields


Functions

disable_animation(self)
Disable all button animations

Parameters:

  • self table Component instance
get_key_trigger(self)
Get key-code to trigger this button

Parameters:

  • self
init(self, node, callback[, params[, anim_node[, event]]])
Component init function

Parameters:

  • self table Component instance
  • node node Gui node
  • callback function Button callback
  • params table Button callback params (optional)
  • anim_node node Button anim node (node, if not provided) (optional)
  • event string Button react event, const.ACTION_TOUCH by default (optional)
set_callback(self, callback)
Set usual button callback

Parameters:

  • self
  • callback
set_click_zone(self, zone)
Strict button click area. Useful for no click events outside stencil node

Parameters:

  • self table Component instance
  • zone node Gui node
set_double_tap_callback(self, callback)
Get doubletap callback on this button

Parameters:

  • self
  • callback
set_hold_callback(self, callback)
Repeat callback always, while holding button

Parameters:

  • self
  • callback
set_long_tap_callback(self, callback)
Single callbacka after long_tap. No usual callback invoked

Parameters:

  • self
  • callback

Tables

events
Component events

Fields:

  • on_click druid_event
  • on_hold_click druid_event
  • on_long_click druid_event
  • on_double_click druid_event
fields
Component fields

Fields:

  • Main node node
generated by LDoc 1.4.6 Last updated 2020-02-23 13:01:03