# Module `component`

Basic class for all Druid components.

To create you component, use component.create

## Functions

get_style() | Get current component style table
set_style(style) | Set current component style table
get_template() | Get current component template name
set_template(template) | Set current component template name
get_nodes() | Get current component nodes
set_nodes(nodes) | Set current component nodes
get_context() | Get current component context
set_context(context) | Set current component context
get_interests() | Get current component interests
get_node(node_or_name) | Get node for component by name.
get_druid() | Return druid with context of calling component.
setup_component(table, table) | Setup component context and his style table
Component.create(name, interest) | Create new component.

## Functions

get_style()
  Get current component style table

  ### Returns:

  table Component style table
set_style(style)
  Set current component style table

  ### Parameters:

  - style table Druid style module
get_template()
  Get current component template name

  ### Returns:

  string Component template name
set_template(template)
  Set current component template name

  ### Parameters:

  - template string Component template name
get_nodes()
  Get current component nodes

  ### Returns:

  table Component nodes table
set_nodes(nodes)
  Set current component nodes

  ### Parameters:

  - nodes table Component nodes table
get_context()
  Get current component context

  ### Returns:

  table Component context
set_context(context)
  Set current component context

  ### Parameters:

  - context table Druid context. Usually it is self of script
get_interests()
  Get current component interests

  ### Returns:

  table List of component interests
get_node(node_or_name)
  Get node for component by name. If component has nodes, nodeorname should be string It auto pick node by template name or from nodes by clonetree if they was setup via component:setnodes, component:set_template

  ### Parameters:

  - node_or_name string or node Node name or node itself

  ### Returns:

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

  ### Returns:

  Druid Druid instance with component context
setup_component(table, table)
  Setup component context and his style table

  ### Parameters:

  - table style Druid style module
  - table style Druid style module

  ### Returns:

  Component Component itself
Component.create(name, interest)
  Create new component. It will inheritance from basic druid component.

  ### Parameters:

  - name string Component name
  - interest table List of component's interest

generated by LDoc 1.4.6 Last updated 2020-03-22 15:31:43