# Defold Druid UI Library

# Module `Layout`

Layout management on node

## Functions

fit_into_node(self[, node]) | Set node for layout node to fit inside it.
fit_into_size(self, target_size) | Set size for layout node to fit inside it
fit_into_window(self) | Set current size for layout node to fit inside it
init(self, node, mode[, on_size_changed_callback]) | Component init function
set_max_size(self, max_size) | Set maximum size of layout node
set_min_size(self, min_size) | Set minimal size of layout node
set_origin_position(self, new_origin_position) | Set new origin position of layout node.
set_origin_size(self, new_origin_size) | Set new origin size of layout node.

## Fields

mode | Current layout mode
node | Layout node
on_size_changed | On window resize callback(self, new_size)

## Functions

fit_into_node(self[, node])
  Set node for layout node to fit inside it. Pass nil to reset

  ### Parameters:

  - self Layout Layout
  - node Node (optional)

  ### Returns:

  Layout Layout
fit_into_size(self, target_size)
  Set size for layout node to fit inside it

  ### Parameters:

  - self Layout Layout
  - target_size vector3

  ### Returns:

  Layout Layout
fit_into_window(self)
  Set current size for layout node to fit inside it

  ### Parameters:

  - self Layout Layout

  ### Returns:

  Layout Layout
init(self, node, mode[, on_size_changed_callback])
  Component init function

  ### Parameters:

  - self Layout Layout
  - node node Gui node
  - mode string The layout mode (from const.LAYOUT_MODE)
  - on_size_changed_callback function The callback on window resize (optional)
set_max_size(self, max_size)
  Set maximum size of layout node

  ### Parameters:

  - self Layout Layout
  - max_size vector3

  ### Returns:

  Layout Layout
set_min_size(self, min_size)
  Set minimal size of layout node

  ### Parameters:

  - self Layout Layout
  - min_size vector3

  ### Returns:

  Layout Layout
set_origin_position(self, new_origin_position)
  Set new origin position of layout node. You should apply this on node movement

  ### Parameters:

  - self Layout Layout
  - new_origin_position vector3

  ### Returns:

  Layout Layout
set_origin_size(self, new_origin_size)
  Set new origin size of layout node. You should apply this on node manual size change

  ### Parameters:

  - self Layout Layout
  - new_origin_size vector3

  ### Returns:

  Layout Layout

## Fields

mode
  Current layout mode
  - mode string
node
  Layout node
  - node node
on_size_changed
  On window resize callback(self, new_size)
  - on_size_changed DruidEvent DruidEvent

generated by LDoc TESTING Last updated 2015-01-01 12:00:00