Module BaseComponent

Basic class for all Druid components.

To create you component, use `component.create`

Functions

get_childrens(self) Return all children components, recursive (protected)
get_context(self) Get current component context (protected)
get_druid(self) Return druid with context of calling component (protected).
get_input_priority(self) Return component input priority
get_name(self) Return component name
get_node(self, node_or_name) Get node for component by name.
get_parent_component(self) Return the parent for current component (protected)
get_parent_name(self) Return parent component name
get_template(self) Get current component template name (protected)
get_uid(self) Return component uid (protected).
log_message(self, message, context) Print log information if debug mode is enabled (protected)
reset_input_priority(self) Reset component input priority to default value
set_debug(self, is_debug) Set debug logs for component enabled or disabled
set_input_enabled(self, state) Set component input state.
set_input_priority(self, value) Set component input priority
set_nodes(self, nodes) Set current component nodes (protected)
set_style(self, druid_style) Set current component style table (protected).
set_template(self, template) Set current component template name (protected) It will check parent template name to build full template name

Fields

ON_INPUT Component Interests


Functions

get_childrens(self)
Return all children components, recursive (protected)

Parameters:

Returns:

    table Array of childrens if the Druid component instance
get_context(self)
Get current component context (protected)

Parameters:

Returns:

    table BaseComponent context
get_druid(self)
Return druid with context of calling component (protected). Use it to create component inside of other components.

Parameters:

Returns:

    Druid Druid instance with component context
get_input_priority(self)
Return component input priority

Parameters:

Returns:

    number The component input priority
get_name(self)
Return component name

Parameters:

Returns:

    string The component name
get_node(self, node_or_name)
Get node for component by name. If component has nodes, node_or_name should be string It auto pick node by template name or from nodes by clone_tree if they was setup via component:set_nodes, component:set_template. If node is not found, the exception will fired

Parameters:

Returns:

    node Gui node
get_parent_component(self)
Return the parent for current component (protected)

Parameters:

Returns:

    BaseComponent or nil The druid component instance or nil
get_parent_name(self)
Return parent component name

Parameters:

Returns:

    string or nil The parent component name if exist or bil
get_template(self)
Get current component template name (protected)

Parameters:

Returns:

    string Component full template name
get_uid(self)
Return component uid (protected). UID generated in component creation order

Parameters:

Returns:

    number The component uid
log_message(self, message, context)
Print log information if debug mode is enabled (protected)

Parameters:

reset_input_priority(self)
Reset component input priority to default value

Parameters:

Returns:

    number The component input priority
set_debug(self, is_debug)
Set debug logs for component enabled or disabled

Parameters:

set_input_enabled(self, state)
Set component input state. By default it enabled You can disable any input of component by this function

Parameters:

  • self BaseComponent BaseComponent
  • state bool The component input state

Returns:

    BaseComponent BaseComponent itself
set_input_priority(self, value)
Set component input priority

Parameters:

  • self BaseComponent BaseComponent
  • value number The new input priority value

Returns:

    number The component input priority
set_nodes(self, nodes)
Set current component nodes (protected)

Parameters:

Returns:

    BaseComponent BaseComponent
set_style(self, druid_style)
Set current component style table (protected). Invoke `on_style_change` on component, if exist. BaseComponent should handle their style changing and store all style params

Parameters:

set_template(self, template)
Set current component template name (protected) It will check parent template name to build full template name

Parameters:

Returns:

    BaseComponent BaseComponent

Fields

ON_INPUT
Component Interests
generated by LDoc 1.4.6 Last updated 2022-03-11 20:55:29