Module druid.button

Component to handle basic GUI button

Functions

init(self, node, callback[, params[, anim_node[, event]]]) Component init function
disable_animation(self) Disable all button animations
set_click_zone(self, zone) Strict button click area.
get_key_trigger(self) Get key-code to trigger this button

Tables

Events Component events
Fields Component fields
Style Component style params


Functions

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)
disable_animation(self)
Disable all button animations

Parameters:

  • self table Component instance
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
get_key_trigger(self)
Get key-code to trigger this button

Parameters:

  • self

Tables

Events
Component events

Fields:

  • on_click druid_event On release button callback
  • on_repeated_click druid_event On repeated action button callback
  • on_long_click druid_event On long tap button callback
  • on_double_click druid_event On double tap button callback
Fields
Component fields

Fields:

  • node node Trigger node
  • anim_node node Animation node (default node)
  • scale_from vector3 Initial scale of anim_node
  • pos vector3 Initial pos of anim_node
  • params any Params to click callbacks
  • hover_anim boolean Is hover anim enabled
  • hover druid.hover Druid hover logic component
  • click_zone node Restriction zone (optional)
Style
Component style params

Fields:

  • on_click function (self, node)
  • on_click_disabled function (self, node)
  • on_hover function (self, node, hover_state)
  • on_set_enabled function (self, node, enabled_state)
  • IS_HOVER bool
generated by LDoc 1.4.6 Last updated 2020-02-24 00:03:02