Module BaseComponent

Basic class for all Druid components.

To create you component, use `component.create`

Functions

set_style(self, druid_style) Set current component style table.
set_template(self, template) Set current component template name
set_nodes(self, nodes) Set current component nodes
get_context(self) Get current component context
get_node(self, node_or_name) Get node for component by name.
get_druid(self) Return druid with context of calling component.
get_name(self) Return component name
get_input_priority(self) Return component input priority
set_input_priority(self, value) Set component input priority
reset_input_priority(self) Reset component input priority to default value
get_uid(self) Return component uid.
set_input_enabled(self, state) Set component input state.
get_parent_component(self) Return the parent for current component
setup_component(self, druid_instance, context, style) Setup component context and his style table
get_childrens(self) Return all children components, recursive

Fields

ON_INPUT Component Interests


Functions

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

Parameters:

  • self BaseComponent
  • druid_style table Druid style module
set_template(self, template)
Set current component template name

Parameters:

  • self BaseComponent
  • template string BaseComponent template name
set_nodes(self, nodes)
Set current component nodes

Parameters:

  • self BaseComponent
  • nodes table BaseComponent nodes table
get_context(self)
Get current component context

Parameters:

  • self BaseComponent

Returns:

    table BaseComponent context
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

Parameters:

  • self BaseComponent
  • node_or_name string or node Node name or node itself

Returns:

    node Gui node
get_druid(self)
Return druid with context of calling component. Use it to create component inside of other components.

Parameters:

  • self BaseComponent

Returns:

    Druid Druid instance with component context
get_name(self)
Return component name

Parameters:

  • self BaseComponent

Returns:

    string The component name
get_input_priority(self)
Return component input priority

Parameters:

  • self BaseComponent

Returns:

    number The component input priority
set_input_priority(self, value)
Set component input priority

Parameters:

  • self BaseComponent
  • value number The new input priority value

Returns:

    number The component input priority
reset_input_priority(self)
Reset component input priority to default value

Parameters:

  • self BaseComponent

Returns:

    number The component input priority
get_uid(self)
Return component uid. UID generated in component creation order

Parameters:

  • self BaseComponent

Returns:

    number The component uid
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
  • state bool The component input state

Returns:

    BaseComponent BaseComponent itself
get_parent_component(self)
Return the parent for current component

Parameters:

  • self BaseComponent

Returns:

    druid.base_component or nil The druid component instance or nil
setup_component(self, druid_instance, context, style)
Setup component context and his style table

Parameters:

  • self BaseComponent
  • druid_instance table The parent druid instance
  • context table Druid context. Usually it is self of script
  • style table Druid style module

Returns:

    component BaseComponent itself
get_childrens(self)
Return all children components, recursive

Parameters:

  • self BaseComponent

Returns:

    table Array of childrens if the Druid component instance

Fields

ON_INPUT
Component Interests
generated by LDoc 1.4.6 Last updated 2022-02-12 16:59:51