diff --git a/docs/index.html b/docs/index.html index cd47334..33c7f80 100644 --- a/docs/index.html +++ b/docs/index.html @@ -34,23 +34,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -61,7 +62,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -86,6 +88,42 @@ druid.button Component to handle basic GUI button + + druid.drag + Component to handle drag action on node. + + + druid.hover + Component to handle hover node interaction + + + druid.scroll + Component to handle scroll content. + + + druid.static_grid + Component to handle placing components by row and columns. + + + druid.swipe + Component to handle swipe gestures on node. + + + druid.text + Component to handle all GUI texts. + + + component + Basic class for all Druid components. + + + druid + Druid UI Library. + + + druid_event + Lua event small library + druid.checkbox Druid checkbox component @@ -95,16 +133,8 @@ Checkbox group module - druid.drag - Component to handle drag action on node. - - - druid.grid - Component to handle placing components by row and columns. - - - druid.hover - Component to handle hover node interaction + druid.dynamic_grid + Component to handle placing components in row druid.input @@ -123,45 +153,21 @@ druid.radio_group Radio group module - - druid.scroll - Component to handle scroll content. - druid.slider Druid slider component - - druid.swipe - Component to handle swipe gestures on node. - - - druid.text - Component to handle all GUI texts. - druid.timer Component to handle GUI timers. - - component - Basic class for all Druid components. - - - druid - Druid UI Library. - - - druid_event - Lua event small library - druid.helper Text node or icon node can be nil druid_instance - Druid main class. + Instance of Druid.

    Topics

    @@ -190,6 +196,10 @@ changelog.md + + faq.md + + README.md @@ -200,7 +210,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/modules/component.html b/docs/modules/component.html index 7dcbe5c..597d4c2 100644 --- a/docs/modules/component.html +++ b/docs/modules/component.html @@ -41,23 +41,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -68,7 +69,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -88,18 +90,10 @@ 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 @@ -108,14 +102,6 @@ Get current component context - set_context(context) - Set current component context - - - get_interests() - Get current component interests - - increase_input_priority() Increase input priority in current input stack @@ -132,18 +118,46 @@ Return druid with context of calling component. - is_child_of() - Return true, if current component is child of another component - - get_name() Return component name + set_input_enabled(state) + Set component input state. + + + get_parent_component() + Return the parent for current component + + setup_component(table, table, table) Setup component context and his style table + __set_context(context) + Set current component context + + + __get_interests() + Get current component interests + + + __get_template() + Get current component template name + + + __get_nodes() + Get current component nodes + + + __add_children(children) + Add child to component children list + + + __remove_children(children) + Remove child from component children list + + Component.create(name[, interest={}]) Create new component. @@ -178,26 +192,6 @@ - -
    - - get_template() -
    -
    - Get current component template name - - - -

    Returns:

    -
      - - string - Component template name -
    - - - -
    @@ -219,26 +213,6 @@ - -
    - - get_nodes() -
    -
    - Get current component nodes - - - -

    Returns:

    -
      - - table - Component nodes table -
    - - - -
    @@ -280,47 +254,6 @@ - -
    - - set_context(context) -
    -
    - Set current component context - - -

    Parameters:

    - - - - - - -
    -
    - - get_interests() -
    -
    - Get current component interests - - - -

    Returns:

    -
      - - table - List of component interests -
    - - - -
    @@ -400,26 +333,6 @@ - -
    - - is_child_of() -
    -
    - Return true, if current component is child of another component - - - -

    Returns:

    -
      - - bool - True, if current component is child of another -
    - - - -
    @@ -440,6 +353,54 @@ + +
    + + set_input_enabled(state) +
    +
    + Set component input state. By default it enabled + You can disable any input of component by this function + + +

    Parameters:

    + + +

    Returns:

    +
      + + Component + Component itself +
    + + + + +
    +
    + + get_parent_component() +
    +
    + Return the parent for current component + + + +

    Returns:

    +
      + + Component or nil + The druid component instance or nil +
    + + + +
    @@ -468,13 +429,136 @@

    Returns:

      - Component + component Component itself
    + +
    + + __set_context(context) +
    +
    + Set current component context + + +

    Parameters:

    + + + + + + +
    +
    + + __get_interests() +
    +
    + Get current component interests + + + +

    Returns:

    +
      + + table + List of component interests +
    + + + + +
    +
    + + __get_template() +
    +
    + Get current component template name + + + +

    Returns:

    +
      + + string + Component template name +
    + + + + +
    +
    + + __get_nodes() +
    +
    + Get current component nodes + + + +

    Returns:

    +
      + + table + Component nodes table +
    + + + + +
    +
    + + __add_children(children) +
    +
    + Add child to component children list + + +

    Parameters:

    + + + + + + +
    +
    + + __remove_children(children) +
    +
    + Remove child from component children list + + +

    Parameters:

    + + + + + +
    @@ -510,7 +594,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/modules/druid.back_handler.html b/docs/modules/druid.back_handler.html index a97c4c4..5971afb 100644 --- a/docs/modules/druid.back_handler.html +++ b/docs/modules/druid.back_handler.html @@ -42,23 +42,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -69,7 +70,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -218,7 +220,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/modules/druid.blocker.html b/docs/modules/druid.blocker.html index e08833b..2d25873 100644 --- a/docs/modules/druid.blocker.html +++ b/docs/modules/druid.blocker.html @@ -42,23 +42,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -69,7 +70,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -237,7 +239,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/modules/druid.button.html b/docs/modules/druid.button.html index ed24186..6a9e58f 100644 --- a/docs/modules/druid.button.html +++ b/docs/modules/druid.button.html @@ -42,23 +42,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -69,7 +70,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -448,7 +450,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/modules/druid.checkbox.html b/docs/modules/druid.checkbox.html index 5391bf0..d432cb6 100644 --- a/docs/modules/druid.checkbox.html +++ b/docs/modules/druid.checkbox.html @@ -42,23 +42,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -69,7 +70,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -282,7 +284,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/modules/druid.checkbox_group.html b/docs/modules/druid.checkbox_group.html index eaf898f..f2aba40 100644 --- a/docs/modules/druid.checkbox_group.html +++ b/docs/modules/druid.checkbox_group.html @@ -42,23 +42,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -69,7 +70,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -242,7 +244,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/modules/druid.drag.html b/docs/modules/druid.drag.html index 3ffc533..d71152b 100644 --- a/docs/modules/druid.drag.html +++ b/docs/modules/druid.drag.html @@ -42,23 +42,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -69,7 +70,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -282,7 +284,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/modules/druid.dynamic_grid.html b/docs/modules/druid.dynamic_grid.html new file mode 100644 index 0000000..1bc6a53 --- /dev/null +++ b/docs/modules/druid.dynamic_grid.html @@ -0,0 +1,496 @@ + + + + + Defold Druid UI Library + + + + +
    + +
    + +
    +
    +
    + + +
    + + + + + + +
    + +

    Module druid.dynamic_grid

    +

    Component to handle placing components in row

    +

    + +

    + + +

    Functions

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    init(parent)Component init function
    get_pos(index, node)Return pos for grid node index
    add(node[, index[, is_shift_left=false]])Add new node to the grid
    remove(index[, is_shift_left=false])Remove the item from the grid.
    get_size()Return grid content size
    get_index_by_node(node)Return grid index by node
    get_all_pos()Return array of all node positions
    set_position_function(callback)Change set position function for grid nodes.
    clear()Clear grid nodes array.
    DynamicGrid:_get_side_vector(side, is_forward)Return side vector to correct node shifting
    +

    Tables

    + + + + + + + + + +
    EventsComponent events
    FieldsComponent fields
    + +
    +
    + + +

    Functions

    + +
    +
    + + init(parent) +
    +
    + Component init function + + +

    Parameters:

    +
      +
    • parent + node + The gui node parent, where items will be placed +
    • +
    + + + + + +
    +
    + + get_pos(index, node) +
    +
    + Return pos for grid node index + + +

    Parameters:

    +
      +
    • index + number + The grid element index +
    • +
    • node + node + The node to be placed +
    • +
    + +

    Returns:

    +
      + + vector3 + Node position +
    + + + + +
    +
    + + add(node[, index[, is_shift_left=false]]) +
    +
    + Add new node to the grid + + +

    Parameters:

    +
      +
    • node + node + Gui node +
    • +
    • index + number + The node position. By default add as last node + (optional) +
    • +
    • is_shift_left + bool + If true, shift all nodes to the left, otherwise shift nodes to the right + (default false) +
    • +
    + + + + + +
    +
    + + remove(index[, is_shift_left=false]) +
    +
    + Remove the item from the grid. Note that gui node will be not deleted + + +

    Parameters:

    +
      +
    • index + number + The grid node index to remove +
    • +
    • is_shift_left + bool + If true, shift all nodes to the left, otherwise shift nodes to the right + (default false) +
    • +
    + + + + + +
    +
    + + get_size() +
    +
    + Return grid content size + + + +

    Returns:

    +
      + + vector3 + The grid content size +
    + + + + +
    +
    + + get_index_by_node(node) +
    +
    + Return grid index by node + + +

    Parameters:

    +
      +
    • node + node + The gui node in the grid +
    • +
    + +

    Returns:

    +
      + + number + The node index +
    + + + + +
    +
    + + get_all_pos() +
    +
    + Return array of all node positions + + + +

    Returns:

    +
      + + vector3[] + All grid node positions +
    + + + + +
    +
    + + set_position_function(callback) +
    +
    + Change set position function for grid nodes. It will call on + update poses on grid elements. Default: gui.set_position + + +

    Parameters:

    +
      +
    • callback + function + Function on node set position +
    • +
    + +

    Returns:

    +
      + + druid.dynamic_grid + Current grid instance +
    + + + + +
    +
    + + clear() +
    +
    + Clear grid nodes array. GUI nodes will be not deleted! + If you want to delete GUI nodes, use dynamic_grid.nodes array before grid:clear + + + +

    Returns:

    +
      + + druid.dynamic_grid + Current grid instance +
    + + + + +
    +
    + + DynamicGrid:_get_side_vector(side, is_forward) +
    +
    + Return side vector to correct node shifting + + +

    Parameters:

    +
      +
    • side + + + +
    • +
    • is_forward + + + +
    • +
    + + + + + +
    +
    +

    Tables

    + +
    +
    + + Events +
    +
    + Component events + + +

    Fields:

    +
      +
    • on_add_item + druid_event + On item add callback +
    • +
    • on_remove_item + druid_event + On item remove callback +
    • +
    • on_change_items + druid_event + On item add or remove callback +
    • +
    • on_clear + druid_event + On grid clear callback +
    • +
    • on_update_positions + druid_event + On update item positions callback +
    • +
    + + + + + +
    +
    + + Fields +
    +
    + Component fields + + +

    Fields:

    +
      +
    • parent + node + Parent gui node +
    • +
    • nodes + node[] + List of all grid nodes +
    • +
    • first_index + number + The first index of node in grid +
    • +
    • last_index + number + The last index of node in grid +
    • +
    • node_size + vector3 + Item size +
    • +
    • border + vector4 + The size of item content +
    • +
    + + + + + +
    +
    + + +
    +
    +
    +generated by LDoc 1.4.6 +Last updated 2020-09-29 23:46:16 +
    +
    + + diff --git a/docs/modules/druid.helper.html b/docs/modules/druid.helper.html index fa7d7d7..6986acf 100644 --- a/docs/modules/druid.helper.html +++ b/docs/modules/druid.helper.html @@ -41,23 +41,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -68,7 +69,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -113,6 +115,10 @@ get_border() Distance from node to size border + + deprecated(message) + Show deprecated message. +
    @@ -290,6 +296,27 @@ + +
    + + deprecated(message) +
    +
    + Show deprecated message. Once time per message + + +

    Parameters:

    + + + + + +
    @@ -298,7 +325,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/modules/druid.hover.html b/docs/modules/druid.hover.html index bcf21b1..7115172 100644 --- a/docs/modules/druid.hover.html +++ b/docs/modules/druid.hover.html @@ -42,23 +42,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -69,7 +70,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -294,7 +296,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/modules/druid.html b/docs/modules/druid.html index b3a108b..85bca7f 100644 --- a/docs/modules/druid.html +++ b/docs/modules/druid.html @@ -41,23 +41,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -68,7 +69,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -329,7 +331,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/modules/druid.input.html b/docs/modules/druid.input.html index 37d842c..d8292b2 100644 --- a/docs/modules/druid.input.html +++ b/docs/modules/druid.input.html @@ -42,23 +42,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -69,7 +70,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -388,7 +390,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/modules/druid.lang_text.html b/docs/modules/druid.lang_text.html index 2edcdb4..a5d6b07 100644 --- a/docs/modules/druid.lang_text.html +++ b/docs/modules/druid.lang_text.html @@ -42,23 +42,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -69,7 +70,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -243,7 +245,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/modules/druid.progress.html b/docs/modules/druid.progress.html index 2641e70..1f70c03 100644 --- a/docs/modules/druid.progress.html +++ b/docs/modules/druid.progress.html @@ -42,23 +42,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -69,7 +70,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -386,7 +388,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/modules/druid.radio_group.html b/docs/modules/druid.radio_group.html index 7f4fab6..fe429d0 100644 --- a/docs/modules/druid.radio_group.html +++ b/docs/modules/druid.radio_group.html @@ -42,23 +42,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -69,7 +70,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -242,7 +244,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/modules/druid.scroll.html b/docs/modules/druid.scroll.html index f9e2799..5410563 100644 --- a/docs/modules/druid.scroll.html +++ b/docs/modules/druid.scroll.html @@ -42,23 +42,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -69,7 +70,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -133,6 +135,23 @@ set_points(points) Set points of interest. + + set_horizontal_scroll(state) + Lock or unlock horizontal scroll + + + set_vertical_scroll(state) + Lock or unlock vertical scroll + + + bind_grid(Druid) + Bind the grid component (Static or Dynamic) to recalculate + scroll size on grid changes + + + Scroll:_cancel_animate() + Cancel animation on other animation or input touch +

    Tables

    @@ -443,6 +462,102 @@ + +
    + + set_horizontal_scroll(state) +
    +
    + Lock or unlock horizontal scroll + + +

    Parameters:

    + + +

    Returns:

    +
      + + druid.scroll + Current scroll instance +
    + + + + +
    +
    + + set_vertical_scroll(state) +
    +
    + Lock or unlock vertical scroll + + +

    Parameters:

    + + +

    Returns:

    +
      + + druid.scroll + Current scroll instance +
    + + + + +
    +
    + + bind_grid(Druid) +
    +
    + Bind the grid component (Static or Dynamic) to recalculate + scroll size on grid changes + + +

    Parameters:

    + + +

    Returns:

    +
      + + druid.scroll + Current scroll instance +
    + + + + +
    +
    + + Scroll:_cancel_animate() +
    +
    + Cancel animation on other animation or input touch + + + + + + +

    Tables

    @@ -610,7 +725,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/modules/druid.slider.html b/docs/modules/druid.slider.html index c952191..4c95cc7 100644 --- a/docs/modules/druid.slider.html +++ b/docs/modules/druid.slider.html @@ -42,23 +42,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -69,7 +70,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -281,7 +283,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/modules/druid.static_grid.html b/docs/modules/druid.static_grid.html new file mode 100644 index 0000000..347b207 --- /dev/null +++ b/docs/modules/druid.static_grid.html @@ -0,0 +1,522 @@ + + + + + Defold Druid UI Library + + + + +
    + +
    + +
    +
    +
    + + +
    + + + + + + +
    + +

    Module druid.static_grid

    +

    Component to handle placing components by row and columns.

    +

    Grid can anchor your elements, get content size and other

    + + +

    Functions

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    init(parent, element[, in_row=1])Component init function
    get_pos(index)Return pos for grid node index
    get_index(pos)Return index for grid pos
    get_index_by_node(node)Return grid index by node
    set_anchor(anchor)Set grid anchor.
    add(item[, index])Add new item to the grid
    remove(index, is_shift_nodes)Remove the item from the grid.
    get_size()Return grid content size
    get_all_pos()Return array of all node positions
    set_position_function(callback)Change set position function for grid nodes.
    clear()Clear grid nodes array.
    +

    Tables

    + + + + + + + + + +
    EventsComponent events
    FieldsComponent fields
    + +
    +
    + + +

    Functions

    + +
    +
    + + init(parent, element[, in_row=1]) +
    +
    + Component init function + + +

    Parameters:

    + + + + + + +
    +
    + + get_pos(index) +
    +
    + Return pos for grid node index + + +

    Parameters:

    + + +

    Returns:

    +
      + + vector3 + Node position +
    + + + + +
    +
    + + get_index(pos) +
    +
    + Return index for grid pos + + +

    Parameters:

    + + +

    Returns:

    +
      + + number + The node index +
    + + + + +
    +
    + + get_index_by_node(node) +
    +
    + Return grid index by node + + +

    Parameters:

    + + +

    Returns:

    +
      + + number + The node index +
    + + + + +
    +
    + + set_anchor(anchor) +
    +
    + Set grid anchor. Default anchor is equal to anchor of grid parent node + + +

    Parameters:

    + + + + + + +
    +
    + + add(item[, index]) +
    +
    + Add new item to the grid + + +

    Parameters:

    + + + + + + +
    +
    + + remove(index, is_shift_nodes) +
    +
    + Remove the item from the grid. Note that gui node will be not deleted + + +

    Parameters:

    + + + + + + +
    +
    + + get_size() +
    +
    + Return grid content size + + + +

    Returns:

    +
      + + vector3 + The grid content size +
    + + + + +
    +
    + + get_all_pos() +
    +
    + Return array of all node positions + + + +

    Returns:

    +
      + + vector3[] + All grid node positions +
    + + + + +
    +
    + + set_position_function(callback) +
    +
    + Change set position function for grid nodes. It will call on + update poses on grid elements. Default: gui.set_position + + +

    Parameters:

    + + +

    Returns:

    +
      + + druid.static_grid + Current grid instance +
    + + + + +
    +
    + + clear() +
    +
    + Clear grid nodes array. GUI nodes will be not deleted! + If you want to delete GUI nodes, use static_grid.nodes array before grid:clear + + + +

    Returns:

    +
      + + druid.static_grid + Current grid instance +
    + + + + +
    +
    +

    Tables

    + +
    +
    + + Events +
    +
    + Component events + + +

    Fields:

    + + + + + + +
    +
    + + Fields +
    +
    + Component fields + + +

    Fields:

    + + + + + + +
    +
    + + + + +
    +generated by LDoc 1.4.6 +Last updated 2020-09-29 23:46:16 +
    + + + diff --git a/docs/modules/druid.swipe.html b/docs/modules/druid.swipe.html index 339ae62..eb364c5 100644 --- a/docs/modules/druid.swipe.html +++ b/docs/modules/druid.swipe.html @@ -42,23 +42,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -69,7 +70,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -256,7 +258,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/modules/druid.text.html b/docs/modules/druid.text.html index e3fbea8..b3b2feb 100644 --- a/docs/modules/druid.text.html +++ b/docs/modules/druid.text.html @@ -42,23 +42,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -69,7 +70,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -407,7 +409,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/modules/druid.timer.html b/docs/modules/druid.timer.html index 3c2675a..8468527 100644 --- a/docs/modules/druid.timer.html +++ b/docs/modules/druid.timer.html @@ -42,23 +42,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -69,7 +70,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -296,7 +298,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/modules/druid_event.html b/docs/modules/druid_event.html index 3e03611..ecc8a58 100644 --- a/docs/modules/druid_event.html +++ b/docs/modules/druid_event.html @@ -41,23 +41,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -68,7 +69,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -242,7 +244,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/modules/druid_instance.html b/docs/modules/druid_instance.html index 4a0ae8c..c0865a3 100644 --- a/docs/modules/druid_instance.html +++ b/docs/modules/druid_instance.html @@ -41,23 +41,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -68,7 +69,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • @@ -77,9 +79,19 @@

    Module druid_instance

    -

    Druid main class.

    -

    Create instance of this - to start creating components

    +

    Instance of Druid.

    +

    Make one instance per gui_script with next code:

    + + +
    +local druid = require("druid.druid")
    +function init(self)
    +    self.druid = druid.new(self)
    +    local button = self.druid:new_button(...)
    +end
    +
    + +

    Learn Druid instance function here

    See also:

    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/topics/01-components.md.html b/docs/topics/01-components.md.html index 29a51b8..e470172 100644 --- a/docs/topics/01-components.md.html +++ b/docs/topics/01-components.md.html @@ -45,7 +45,8 @@
  • Checkbox group
  • Radio group
  • Timer
  • -
  • Grid
  • +
  • Static Grid
  • +
  • Dynamic Grid
  • Hover
  • Swipe
  • Drag
  • @@ -59,7 +60,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • Modules

    @@ -67,23 +69,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -109,6 +112,9 @@

    Create button with druid: button = druid:new_button(node_name, callback, [params], [animation_node]) Where node name is name of node from GUI scene. You can use node_name as input trigger zone and point another node for animation via animation_node

    +

    Usecase

    +

    fill example usecases

    +

    Notes

    - Button callback have next params: (self, params, button_instance)

    @@ -262,6 +268,7 @@ Key is value from druid const: const.SIDE.X (or just "x") or const.SIDE.Y (or ju - Progress bar can fill only by vertical or horizontal size. If you want make diagonal progress bar, just rotate node in GUI scene - If you have glitchy or dark texture bug with progress bar, try to disable mipmaps in your texture profiles

    +

    Slider

    Slider API here

    @@ -278,12 +285,13 @@ Key is value from druid const: const.SIDE.X (or just "x") or const.SIDE.Y (or ju

    - You can setup points of interests on slider via slider:set_steps. If steps are exist, slider values will be only from this steps (notched slider) - For now, start pos and end pos should be on vertical or horizontal line (their x or y value should be equal)

    +

    Input

    Input API here

    Overview

    -

    Basic Druid text input component (unimplemented)

    +

    Basic Druid text input component

    Setup

    Create input component with druid: input = druid:new_input(button_node_name, text_node_name, keyboard_type)

    @@ -313,6 +321,7 @@ Key is value from druid const: const.SIDE.X (or just "x") or const.SIDE.Y (or ju

    - Checkbox uses button to handle click - You can setup another node to handle input with click_node arg in component init: druid:new_checkbox(node, callback, [click_node])

    +

    Checkbox group

    Checkbox group API here

    @@ -343,6 +352,7 @@ Key is value from druid const: const.SIDE.X (or just "x") or const.SIDE.Y (or ju - You can get/set radio_group state with group:set_state() and group:get_state() - Only different from checkbox_group: on click another checkboxes in this group will be unchecked

    +

    Timer

    Timer API here

    @@ -358,22 +368,53 @@ Key is value from druid const: const.SIDE.X (or just "x") or const.SIDE.Y (or ju - Timer will setup text node with current timer value - Timer uses update function to handle time

    -

    -

    Grid

    -

    Grid API here

    + +

    +

    Static Grid

    +

    Static Grid API here

    Overview

    -

    Component for manage node positions. Very simple implementation for nodes with equal size

    +

    Component for manage node positions. +Static grid have constant node size, so it possible to calculate node positions before placement. Nodes can be placed with gaps. +Static grid can shift elements on add/remove functions.

    Setup

    -

    Create component with druid: grid = druid:new_grid(parent_node, prefab_node, max_in_row_elements)

    +

    Create component with druid: grid = druid:new_static_grid(parent_node, prefab_node, max_in_row_elements)

    Notes

    -

    - Grid on adding elements will setup parent to parentnode_ +

    - On add node grid will set node parent to parentnode_ - You can get array of position of every element for setup points of interest in scroll component - You can get size of all elements for setup size in scroll component -- You can adjust anchor and border between elements -- Prefab node in component init used to get grid item size

    +- You can also bind the grid to the scroll component for auto resize scroll content size +- Pivot of parent_node matter for node placement +- Prefab node used to get node size and anchor +- You can point *position_function* for animations with staticgrid:setpositionfunction(node, pos)_ callback. Default - *gui.set_position()*

    + + +

    +

    Dynamic Grid

    +

    Dynamic Grid API here

    + +

    Overview

    +

    Component for manage node positions with different node sizes. +Unlike Static Grid, Dynamic Grid can place nodes only in one row or in one column. +Dynamic Grid can't have gaps between elements - you will get error, if try spawn element far away from others. +Dynamic Grid should have West, East, South or North pivot (vertical or horizontal element placement)

    + +

    Setup

    +

    Create component with druid: grid = druid:new_dynamic_grid(parent_node)

    + +

    Check the parentnode_ have correct pivot point. You will get the error otherwise.

    + +

    Notes

    +

    - On add node grid will set node parent to parentnode_ +- You can get array of position of every element for setup points of interest in scroll component +- You can get size of all elements for setup size in scroll component +- You can also bind the grid to the scroll component for auto resize scroll content size +- Pivot of parentnode matter for node placement +- You can point *positionfunction* for animations with staticgrid:setpositionfunction(node, pos)_ callback. Default - *gui.set_position()* +- First node placed at Grid pivot point. Other nodes placed nearby of other nodes. +- On add/remove nodes always shifted. You can point the shift side in this functions (*isshiftleft* boolean argument)

    Hover

    @@ -465,7 +506,7 @@ Key is value from druid const: const.SIDE.X (or just "x") or const.SIDE.Y (or ju
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/topics/02-creating_custom_components.md.html b/docs/topics/02-creating_custom_components.md.html index 5938201..48f3bd6 100644 --- a/docs/topics/02-creating_custom_components.md.html +++ b/docs/topics/02-creating_custom_components.md.html @@ -46,7 +46,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • Modules

    @@ -54,23 +55,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -245,7 +247,7 @@ There is next interests in druid:
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/topics/03-styles.md.html b/docs/topics/03-styles.md.html index a1da483..b4d8cf0 100644 --- a/docs/topics/03-styles.md.html +++ b/docs/topics/03-styles.md.html @@ -45,7 +45,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • Modules

    @@ -53,23 +54,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -155,7 +157,7 @@ You can pass nil or emptytable_ to use default values for all
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/topics/04-druid_assets.md.html b/docs/topics/04-druid_assets.md.html index 1272c79..8270e0e 100644 --- a/docs/topics/04-druid_assets.md.html +++ b/docs/topics/04-druid_assets.md.html @@ -43,7 +43,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • Modules

    @@ -51,23 +52,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -92,7 +94,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/topics/05-examples.md.html b/docs/topics/05-examples.md.html index b7b7f5e..140bf25 100644 --- a/docs/topics/05-examples.md.html +++ b/docs/topics/05-examples.md.html @@ -43,7 +43,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • Modules

    @@ -51,23 +52,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -90,7 +92,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/topics/README.md.html b/docs/topics/README.md.html index b0e8677..7c0a416 100644 --- a/docs/topics/README.md.html +++ b/docs/topics/README.md.html @@ -36,8 +36,8 @@
  • Components
  • Basic usage
  • Druid Events
  • -
  • Druid lifecycle
  • -
  • Features
  • +
  • Druid Lifecycle
  • +
  • Details
  • Examples
  • Documentation
  • Games powered by Druid
  • @@ -53,7 +53,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • Modules

    @@ -61,23 +62,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -90,7 +92,7 @@

    GitHub release (latest by date)

    -

    Druid - powerful Defold component UI library. Use basic Druid components or make your own game-specific components to make amazing GUI in your games.

    +

    Druid - powerful Defold component UI library. Use basic and extended Druid components or make your own game-specific components to make amazing GUI in your games.

    @@ -125,7 +127,7 @@

    Input capturing [optional]

    -

    By default, Druid will auto-capture input focus, if any input component will be created. So you don't need to call msg.post(".", "acquire_input_focus)"

    +

    By default, Druid will auto-capture input focus, if any input component will be created. So you don't need to call msg.post(".", "acquire_input_focus")

    If you not need this behaviour, you can disable it by settings druid.no_auto_input field in game.project:

     [druid]
    @@ -155,10 +157,6 @@
     -- to retranslate all lang_text components:
     druid.on_language_change()
     
    --- Call this function on layout changing in the game,
    --- to reapply layouts
    -druid.on_layout_change()
    -
     -- Call this function inside window.set_listener
     -- to catch game focus lost/gained callbacks:
     druid.on_window_callback(event)
    @@ -169,29 +167,37 @@
     

    Components

    -

    Druid provides next basic components:

    +

    Druid provides next basic components:

    -

    Full info see on components.md

    +

    Druid also provides next extended components:

    + +

    *Note: In future, to use extended components, you should register them first. It's required for make Druid modular - to exclude unused components from build*

    + + + +

    Full info see on components.md

    @@ -226,6 +232,8 @@
    +

    Learn Druid instance functions here)

    +

    Druid Events

    @@ -237,13 +245,12 @@
  • event:clear()

  • -

    Any events can handle several callbacks, if needed.

    +

    You can subscribe several callbacks on single event.

    +

    +

    Druid Lifecycle

    -

    -

    Druid lifecycle

    - -

    Here is full druid lifecycle setup in your *.gui_script file:

    +

    Here is full Druid lifecycle setup in your *.gui_script file:

     local druid = require("druid.druid")
    @@ -271,24 +278,27 @@
     
     
     
     
    -

    Recommended is fully integrate all druid lifecycles functions

    +

    Recommended is fully integrate all Druid lifecycles functions

    -

    -

    Features

    +

    +

    Details

    +

    See full See FAQ here

    +

    Examples

    @@ -304,10 +314,11 @@

    Documentation

    To learn Druid better, read next documentation: -- Druid components -- Create custom components -- Druid styles -- Druid asset store

    +- Druid components +- Create custom components +- See FAQ article +- Druid styles +- Druid asset store

    Full Druid documentation you can find here: https://insality.github.io/druid/

    @@ -316,15 +327,15 @@ https://insality.github.io/druid/

    Games powered by Druid

    -

    Will fill later

    +

    You published your game and you using Druid? Note me!

    License

    @@ -340,7 +351,7 @@ https://insality.github.io/druid/

    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/topics/changelog.md.html b/docs/topics/changelog.md.html index 762b41e..ac002f0 100644 --- a/docs/topics/changelog.md.html +++ b/docs/topics/changelog.md.html @@ -39,7 +39,8 @@
  • Styles
  • Druid assets
  • Examples
  • -
  • changelog
  • +
  • Druid 0.3.0:
  • +
  • faq
  • README
  • Modules

    @@ -47,23 +48,24 @@
  • druid.back_handler
  • druid.blocker
  • druid.button
  • +
  • druid.drag
  • +
  • druid.hover
  • +
  • druid.scroll
  • +
  • druid.static_grid
  • +
  • druid.swipe
  • +
  • druid.text
  • +
  • component
  • +
  • druid
  • +
  • druid_event
  • druid.checkbox
  • druid.checkbox_group
  • -
  • druid.drag
  • -
  • druid.grid
  • -
  • druid.hover
  • +
  • druid.dynamic_grid
  • druid.input
  • druid.lang_text
  • druid.progress
  • druid.radio_group
  • -
  • druid.scroll
  • druid.slider
  • -
  • druid.swipe
  • -
  • druid.text
  • druid.timer
  • -
  • component
  • -
  • druid
  • -
  • druid_event
  • druid.helper
  • druid_instance
  • @@ -72,7 +74,8 @@
    - Druid 0.3.0:

    + +

    Druid 0.3.0:

    • Druid:final() now is important function for correct working

    • @@ -119,7 +122,7 @@ - Space is not working in HTML5
    -

    Druid 0.4.0:

    +

    Druid 0.4.0:

  • Add Drag basic component

    @@ -157,7 +160,7 @@
     
     
     - Anchor by default equals to node pivot (so, more component settings in _.gui_ settings) (#51)
    -- Function grid:clear now don't delete any GUI nodes. Druid will not care about gui.delete_node logic anymore (#56)
    +- Function grid:clear now don't delete any GUI nodes. Druid will not care about gui.delete_node logic anymore (#56)
     
  • Druid Hover component now have two hover events (#49):

    @@ -188,18 +191,61 @@ -

    Druid 0.5.0: -- Fix #61: Button component: fix button animation node creation -- Fix #64: Hover component: wrong mouse_hover default state -- Fix #71: Blocker: blocker now correct block mouse hover event -- Fix #72: Fix return nil in some on_input functions -- Fix #74: Fix typo: strech -> stretch. Scroll function set_extra_stretch_size renamed +

    Druid 0.5.0:

    + +

    Besides a lot of fixes (thanks for feedback!) two components was add: StaticGrid and DynamicGrid instead of usual Grid component (it is deprecated now). +Add component:setinputenabled for basic component class. So you can enable/disable user input for any component. +Finaly implemented onlayoutchanged support. Druid components now will try keep their data between layout changing! You also can use this callback in your custom components. +Also check component.template.lua what you can use for your own custom components!

    + + + +
    generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 +Last updated 2020-09-29 23:46:16
    diff --git a/docs/topics/faq.md.html b/docs/topics/faq.md.html new file mode 100644 index 0000000..c2e535f --- /dev/null +++ b/docs/topics/faq.md.html @@ -0,0 +1,161 @@ + + + + + Defold Druid UI Library + + + + +
    + +
    + +
    +
    +
    + + +
    + + + + + + +
    + + + +

    Druid FAQ

    + +
    +

    Have questions about Druid? Ask me! + Here is questions you might have

    +
    + +

    Q: Why I want use Druid?

    +

    A: ---

    + + +

    Q: How to remove the Druid component instance?

    +

    A: Any created Druid component can be removed with druid:remove. API reference link.

    + + +

    Q: How to make scroll work?

    +

    A: ---

    + + +

    Q: How the input is processing?

    +

    A: +SImply: the Druid has a LIFO queue to check input. Last added buttons have more priority than first. Placing your buttons from behind to the front is correct in most cases.

    + + +

    Q: For what purpose Blocker component is exist?

    +

    A: Component explanation here. +With Blocker you can block input in some zone. It is useful for make unclickable zone in buttons or kind of buttons panel on other big button (ex. close windows on window background click)

    + + +

    Q: Which stuff can I do with custom components?

    +

    A: Any of you can imagine! There is a lot of examples, but in general: custom components allow you place component and some game logic separately from other stuff. It will be reusable, easier for testing and developing.

    + +

    For example it can be element in scroll with buttons, your custom GUI widget or even component with your game logic. Usually custom components going with templates. You can do several templates for single component module (for different visuals!)

    + +

    Some examples of custom components you can find here.

    + + +

    Q: How *self:get_node()* is working?

    +

    A: The node can be placed in gui directly or can be cloned via *gui.clone_tree()*. Also nodes can be placed as templates, so full node id will be composed from template name and node name (in cloned nodes too).

    + +

    Druid component *self:getnode()* trying to search in all of this places. Use *self:settemplate()* and *self:setcomponentnodes()* for correct setup component nodes before any call of *self:get_node()*.

    + +

    Remember, usually you should pass string name of the node, not gui node itself. It's better and more druid-way.

    + + +

    Q: My button in scroll is clickable outside the stencil node

    +

    A: Since Druid checking click node with gui.picknode_, stencil is not prevent this. You can setup additional click zone on your buttons with button:setclickzone.

    + +

    The usual Druid way after add button to the scroll do:

    + +
    +-- Scroll view node usually is stencil node
    +button:set_click_zone(scroll.view_node)
    +
    + + + +

    Q: How to use EmmyLua annotations? (from Druid 0.6.0)

    +

    A: Since the dependencies can't be processed by external editors, for use generated EmmyLua annotations you should copy the annotations.lua to your project. For EmmyLua it will be enough. Remember you can restart emmylua server for refresh the changes, if something goes wrong. +After the annotations is processed, you should point the type of druid in requires:

    + +
    +---@type druid
    +local druid = require("druid.druid")
    +
    +-- Now the autocomplete is working
    +
    + + + +

    Q: When I should use *onlayoutchange*?

    +

    A: ---

    + + +
    +
    +
    +generated by LDoc 1.4.6 +Last updated 2020-09-29 23:46:16 +
    +
    + + diff --git a/docs_md/faq.md b/docs_md/faq.md index 5fcfd0c..332b510 100644 --- a/docs_md/faq.md +++ b/docs_md/faq.md @@ -49,7 +49,7 @@ The usual Druid way after add button to the scroll do: ```lua -- Scroll view node usually is stencil node button:set_click_zone(scroll.view_node) - ``` +``` ### Q: How to use EmmyLua annotations? _(from Druid 0.6.0)_ diff --git a/druid/extended/component.template.lua b/druid/extended/component.template.lua index bea40d4..fbf33b8 100644 --- a/druid/extended/component.template.lua +++ b/druid/extended/component.template.lua @@ -1,3 +1,6 @@ +--- Druid component template +-- @module druid.component +-- @local local const = require("druid.const") local component = require("druid.component") diff --git a/druid/system/druid_instance.lua b/druid/system/druid_instance.lua index eb91163..e8f4cd9 100644 --- a/druid/system/druid_instance.lua +++ b/druid/system/druid_instance.lua @@ -391,10 +391,10 @@ end --- Create grid basic component +-- Deprecated -- @function druid:new_grid -- @tparam args ... grid init args -- @treturn Component grid component --- @deprecated function Druid:new_grid(...) helper.deprecated("The druid:new_grid is deprecated. Please use druid:new_static_grid instead") return Druid.create(self, static_grid, ...)