# 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
increase_input_priority(self) | Increase input priority in current input stack
reset_input_priority(self) | Reset input priority in current input stack
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
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

## 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
increase_input_priority(self)
  Increase input priority in current input stack

  ### Parameters:

  - self BaseComponent
reset_input_priority(self)
  Reset input priority in current input stack

  ### Parameters:

  - self BaseComponent
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
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

generated by LDoc 1.4.6 Last updated 2020-10-12 00:44:30