Module druid_instance

Instance of Druid.

Make one instance per gui_script with next code:

local druid = require("druid.druid")
function init(self)
    self.druid = druid.new(self)
    local button = self.druid:new_button(...)
end

Learn Druid instance function here

See also:

Functions

druid:initialize(table, table) Druid class constructor
druid:create(component, ...) Create new druid component
druid:final() Call on final function on gui_script.
druid:remove(component) Remove component from druid instance.
druid:update(dt) Druid update function
druid:on_input(action_id, action) Druid on_input function
druid:on_message(message_id, message, sender) Druid on_message function
druid:on_focus_lost() Druid on focus lost interest function.
druid:on_focus_gained() Druid on focus gained interest function.
druid:on_layout_change() Druid on layout change function.
druid.on_language_change() Druid on language change.
druid:new_button(...) Create button basic component
druid:new_blocker(...) Create blocker basic component
druid:new_back_handler(...) Create back_handler basic component
druid:new_hover(...) Create hover basic component
druid:new_text(...) Create text basic component
druid:new_grid(...) Create grid basic component Deprecated
druid:new_static_grid(...) Create static grid basic component
druid:new_scroll(...) Create scroll basic component
druid:new_swipe(...) Create swipe basic component
druid:new_drag(...) Create drag basic component
druid:new_dynamic_grid(...) Create dynamic grid component
druid:new_lang_text(...) Create lang_text component
druid:new_slider(...) Create slider component
druid:new_checkbox(...) Create checkbox component
druid:new_input(...) Create input component
druid:new_checkbox_group(...) Create checkbox_group component
druid:new_radio_group(...) Create radio_group component
druid:new_timer(...) Create timer component
druid:new_progress(...) Create progress component


Functions

druid:initialize(table, table)
Druid class constructor

Parameters:

  • table style Druid style module
  • table style Druid style module
druid:create(component, ...)
Create new druid component

Parameters:

  • component Component Component module
  • ... args Other component params to pass it to component:init function
druid:final()
Call on final function on guiscript. It will call onremove on all druid components
druid:remove(component)
Remove component from druid instance. Component on_remove function will be invoked, if exist.

Parameters:

  • component Component Component instance
druid:update(dt)
Druid update function

Parameters:

  • dt number Delta time
druid:on_input(action_id, action)
Druid on_input function

Parameters:

  • action_id hash Actionid from oninput
  • action table Action from on_input
druid:on_message(message_id, message, sender)
Druid on_message function

Parameters:

  • message_id hash Messageid from onmessage
  • message table Message from on_message
  • sender hash Sender from on_message
druid:on_focus_lost()
Druid on focus lost interest function. This one called by onwindowcallback by global window listener
druid:on_focus_gained()
Druid on focus gained interest function. This one called by onwindowcallback by global window listener
druid:on_layout_change()
Druid on layout change function. Called on update gui layout
druid.on_language_change()
Druid on language change. This one called by global gruid.onlanguagechange, but can be call manualy to update all translations
druid:new_button(...)
Create button basic component

Parameters:

  • ... args button init args

Returns:

    Component button component
druid:new_blocker(...)
Create blocker basic component

Parameters:

  • ... args blocker init args

Returns:

    Component blocker component
druid:new_back_handler(...)
Create back_handler basic component

Parameters:

  • ... args back_handler init args

Returns:

    Component back_handler component
druid:new_hover(...)
Create hover basic component

Parameters:

  • ... args hover init args

Returns:

    Component hover component
druid:new_text(...)
Create text basic component

Parameters:

  • ... args text init args

Returns:

    Component text component
druid:new_grid(...)
Create grid basic component Deprecated

Parameters:

  • ... args grid init args

Returns:

    Component grid component
druid:new_static_grid(...)
Create static grid basic component

Parameters:

  • ... args grid init args

Returns:

    Component grid component
druid:new_scroll(...)
Create scroll basic component

Parameters:

  • ... args scroll init args

Returns:

    Component scroll component
druid:new_swipe(...)
Create swipe basic component

Parameters:

  • ... args swipe init args

Returns:

    Component swipe component
druid:new_drag(...)
Create drag basic component

Parameters:

  • ... args drag init args

Returns:

    Componetn drag component
druid:new_dynamic_grid(...)
Create dynamic grid component

Parameters:

  • ... args grid init args

Returns:

    Component grid component
druid:new_lang_text(...)
Create lang_text component

Parameters:

  • ... args lang_text init args

Returns:

    Component lang_text component
druid:new_slider(...)
Create slider component

Parameters:

  • ... args slider init args

Returns:

    Component slider component
druid:new_checkbox(...)
Create checkbox component

Parameters:

  • ... args checkbox init args

Returns:

    Component checkbox component
druid:new_input(...)
Create input component

Parameters:

  • ... args input init args

Returns:

    Component input component
druid:new_checkbox_group(...)
Create checkbox_group component

Parameters:

  • ... args checkbox_group init args

Returns:

    Component checkbox_group component
druid:new_radio_group(...)
Create radio_group component

Parameters:

  • ... args radio_group init args

Returns:

    Component radio_group component
druid:new_timer(...)
Create timer component

Parameters:

  • ... args timer init args

Returns:

    Component timer component
druid:new_progress(...)
Create progress component

Parameters:

  • ... args progress init args

Returns:

    Component progress component
generated by LDoc 1.4.6 Last updated 2020-09-29 23:46:16