From cebba9a1a32d6eb8258b74a692448192aea7c09c Mon Sep 17 00:00:00 2001 From: Insality Date: Mon, 12 Oct 2020 00:30:03 +0300 Subject: [PATCH] Update documentation --- docs/index.html | 132 +- docs/modules/BackHandler.html | 196 +++ docs/modules/BaseComponent.html | 479 +++++++ docs/modules/Blocker.html | 186 +++ .../{druid.button.html => Button.html} | 556 ++++++--- .../{druid.checkbox.html => Checkbox.html} | 244 ++-- docs/modules/CheckboxGroup.html | 227 ++++ docs/modules/Drag.html | 471 +++++++ .../{druid_event.html => DruidEvent.html} | 128 +- docs/modules/DruidInstance.html | 1110 +++++++++++++++++ ...uid.dynamic_grid.html => DynamicGrid.html} | 400 ++++-- docs/modules/{druid.hover.html => Hover.html} | 135 +- docs/modules/{druid.input.html => Input.html} | 508 +++++--- .../{druid.lang_text.html => LangText.html} | 127 +- .../{druid.progress.html => Progress.html} | 355 ++++-- docs/modules/RadioGroup.html | 227 ++++ .../{druid.scroll.html => Scroll.html} | 637 +++++++--- .../{druid.slider.html => Slider.html} | 257 ++-- ...druid.static_grid.html => StaticGrid.html} | 415 ++++-- docs/modules/{druid.swipe.html => Swipe.html} | 200 +-- docs/modules/{druid.text.html => Text.html} | 357 ++++-- docs/modules/{druid.timer.html => Timer.html} | 232 ++-- docs/modules/component.html | 601 --------- docs/modules/druid.back_handler.html | 227 ---- docs/modules/druid.blocker.html | 246 ---- docs/modules/druid.checkbox_group.html | 251 ---- docs/modules/druid.drag.html | 291 ----- docs/modules/druid.grid.html | 381 ------ docs/modules/druid.helper.html | 59 +- docs/modules/druid.html | 82 +- docs/modules/druid.radio_group.html | 251 ---- docs/modules/druid_instance.html | 997 --------------- docs/topics/01-components.md.html | 513 -------- .../02-creating_custom_components.md.html | 254 ---- docs/topics/03-styles.md.html | 164 --- docs/topics/04-druid_assets.md.html | 101 -- docs/topics/05-examples.md.html | 99 -- docs/topics/README.md.html | 358 ------ docs/topics/changelog.md.html | 252 ---- docs/topics/components.md.html | 162 --- docs/topics/create_custom_components.md.html | 172 --- .../topics/creating_custom_components.md.html | 200 --- docs/topics/druid_assets.md.html | 96 -- docs/topics/examples.md.html | 94 -- docs/topics/faq.md.html | 161 --- docs/topics/online_example.md.html | 86 -- docs/topics/styles.md.html | 145 --- druid/system/druid_instance.lua | 38 +- 48 files changed, 6115 insertions(+), 7745 deletions(-) create mode 100644 docs/modules/BackHandler.html create mode 100644 docs/modules/BaseComponent.html create mode 100644 docs/modules/Blocker.html rename docs/modules/{druid.button.html => Button.html} (51%) rename docs/modules/{druid.checkbox.html => Checkbox.html} (50%) create mode 100644 docs/modules/CheckboxGroup.html create mode 100644 docs/modules/Drag.html rename docs/modules/{druid_event.html => DruidEvent.html} (50%) create mode 100644 docs/modules/DruidInstance.html rename docs/modules/{druid.dynamic_grid.html => DynamicGrid.html} (53%) rename docs/modules/{druid.hover.html => Hover.html} (56%) rename docs/modules/{druid.input.html => Input.html} (53%) rename docs/modules/{druid.lang_text.html => LangText.html} (50%) rename docs/modules/{druid.progress.html => Progress.html} (55%) create mode 100644 docs/modules/RadioGroup.html rename docs/modules/{druid.scroll.html => Scroll.html} (58%) rename docs/modules/{druid.slider.html => Slider.html} (50%) rename docs/modules/{druid.static_grid.html => StaticGrid.html} (55%) rename docs/modules/{druid.swipe.html => Swipe.html} (52%) rename docs/modules/{druid.text.html => Text.html} (50%) rename docs/modules/{druid.timer.html => Timer.html} (51%) delete mode 100644 docs/modules/component.html delete mode 100644 docs/modules/druid.back_handler.html delete mode 100644 docs/modules/druid.blocker.html delete mode 100644 docs/modules/druid.checkbox_group.html delete mode 100644 docs/modules/druid.drag.html delete mode 100644 docs/modules/druid.grid.html delete mode 100644 docs/modules/druid.radio_group.html delete mode 100644 docs/modules/druid_instance.html delete mode 100644 docs/topics/01-components.md.html delete mode 100644 docs/topics/02-creating_custom_components.md.html delete mode 100644 docs/topics/03-styles.md.html delete mode 100644 docs/topics/04-druid_assets.md.html delete mode 100644 docs/topics/05-examples.md.html delete mode 100644 docs/topics/README.md.html delete mode 100644 docs/topics/changelog.md.html delete mode 100644 docs/topics/components.md.html delete mode 100644 docs/topics/create_custom_components.md.html delete mode 100644 docs/topics/creating_custom_components.md.html delete mode 100644 docs/topics/druid_assets.md.html delete mode 100644 docs/topics/examples.md.html delete mode 100644 docs/topics/faq.md.html delete mode 100644 docs/topics/online_example.md.html delete mode 100644 docs/topics/styles.md.html diff --git a/docs/index.html b/docs/index.html index 33c7f80..75ef048 100644 --- a/docs/index.html +++ b/docs/index.html @@ -31,40 +31,29 @@

Modules

-

Topics

- @@ -77,43 +66,43 @@

Modules

- + - + - + - + - + - + - + - + - + - + @@ -121,44 +110,44 @@ - + - + - + - + - + - + - + - + - + - + @@ -166,51 +155,16 @@ - +
druid.back_handlerBackHandler Component to handle back key (android, backspace)
druid.blockerBlocker Component to block input on specify zone by node
druid.buttonButton Component to handle basic GUI button
druid.dragDrag Component to handle drag action on node.
druid.hoverHover Component to handle hover node interaction
druid.scrollScroll Component to handle scroll content.
druid.static_gridStaticGrid Component to handle placing components by row and columns.
druid.swipeSwipe Component to handle swipe gestures on node.
druid.textText Component to handle all GUI texts.
componentBaseComponent Basic class for all Druid components.
Druid UI Library.
druid_eventDruidEvent Lua event small library
druid.checkboxCheckbox Druid checkbox component
druid.checkbox_groupCheckboxGroup Checkbox group module
druid.dynamic_gridDynamicGrid Component to handle placing components in row
druid.inputInput Druid input text component.
druid.lang_textLangText Component to handle all GUI texts Good working with localization system
druid.progressProgress Basic progress bar component.
druid.radio_groupRadioGroup Radio group module
druid.sliderSlider Druid slider component
druid.timerTimer Component to handle GUI timers.
Text node or icon node can be nil
druid_instanceDruidInstance Instance of Druid.
-

Topics

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
01-components.md
02-creating_custom_components.md
03-styles.md
04-druid_assets.md
05-examples.md
changelog.md
faq.md
README.md
generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 +Last updated 2020-10-12 00:29:49
diff --git a/docs/modules/BackHandler.html b/docs/modules/BackHandler.html new file mode 100644 index 0000000..2cb578b --- /dev/null +++ b/docs/modules/BackHandler.html @@ -0,0 +1,196 @@ + + + + + Defold Druid UI Library + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module BackHandler

+

Component to handle back key (android, backspace)

+

+ + +

Functions

+ + + + + + + + + +
init(self, callback[, params])Component init function
on_input(self, action_id, action)Input handler for component
+

Fields

+ + + + + +
on_backOn back handler callback(self, params)
+ +
+
+ + +

Functions

+ +
+
+ + init(self, callback[, params]) +
+
+ Component init function + + +

Parameters:

+
    +
  • self + BackHandler + +
  • +
  • callback + callback + On back button +
  • +
  • params + any + Callback argument + (optional) +
  • +
+ + + + + +
+
+ + on_input(self, action_id, action) +
+
+ Input handler for component + + +

Parameters:

+
    +
  • self + BackHandler + +
  • +
  • action_id + string + on_input action id +
  • +
  • action + table + on_input action +
  • +
+ + + + + +
+
+

Fields

+ +
+
+ + on_back +
+
+ On back handler callback(self, params) + + +
    +
  • on_back + druid_event + +
  • +
+ + + + + +
+
+ + +
+
+
+generated by LDoc 1.4.6 +Last updated 2020-10-12 00:29:49 +
+
+ + diff --git a/docs/modules/BaseComponent.html b/docs/modules/BaseComponent.html new file mode 100644 index 0000000..6587d03 --- /dev/null +++ b/docs/modules/BaseComponent.html @@ -0,0 +1,479 @@ + + + + + Defold Druid UI Library + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

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:29:49 +
+
+ + diff --git a/docs/modules/Blocker.html b/docs/modules/Blocker.html new file mode 100644 index 0000000..c3708dc --- /dev/null +++ b/docs/modules/Blocker.html @@ -0,0 +1,186 @@ + + + + + Defold Druid UI Library + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module Blocker

+

Component to block input on specify zone by node

+

+ + +

Functions

+ + + + + + + + + + + + + +
init(self, node)Component init function
set_enabled(self, state)Set enabled blocker component state
is_enabled(self)Return blocked enabled state
+ +
+
+ + +

Functions

+ +
+
+ + init(self, node) +
+
+ Component init function + + +

Parameters:

+
    +
  • self + Blocker + +
  • +
  • node + node + Gui node +
  • +
+ + + + + +
+
+ + set_enabled(self, state) +
+
+ Set enabled blocker component state + + +

Parameters:

+
    +
  • self + Blocker + +
  • +
  • state + bool + Enabled state +
  • +
+ + + + + +
+
+ + is_enabled(self) +
+
+ Return blocked enabled state + + +

Parameters:

+
    +
  • self + Blocker + +
  • +
+ +

Returns:

+
    + + bool + True, if blocker is enabled +
+ + + + +
+
+ + +
+
+
+generated by LDoc 1.4.6 +Last updated 2020-10-12 00:29:49 +
+
+ + diff --git a/docs/modules/druid.button.html b/docs/modules/Button.html similarity index 51% rename from docs/modules/druid.button.html rename to docs/modules/Button.html index 6a9e58f..83ee195 100644 --- a/docs/modules/druid.button.html +++ b/docs/modules/Button.html @@ -34,100 +34,135 @@

Modules

-

Topics

-
-

Module druid.button

+

Module Button

Component to handle basic GUI button

-

- -

+

Functions

- + - + - + - + - + - +
init(node, callback[, params[, anim_node]])init(self, node, callback[, params[, anim_node]]) Component init function
set_enabled(state)set_enabled(self, state) Set enabled button component state
is_enabled()is_enabled(self) Return button enabled state
set_click_zone(zone)set_click_zone(self, zone) Strict button click area.
set_key_trigger(key)set_key_trigger(self, key) Set key-code to trigger this button
get_key_trigger()get_key_trigger(self) Get key-code to trigger this button

Tables

- - - - - - - - - +
EventsComponent events
FieldsComponent fields
Stylestyle Component style params.
+

Fields

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
on_clickOn release button callback(self, params, button_instance)
on_repeated_clickOn repeated action button callback(self, params, button_instance, click_amount)
on_long_clickOn long tap button callback(self, params, button_instance, time)
on_double_clickOn double tap button callback(self, params, button_instance, click_amount)
on_hold_callbackOn button hold before long_click callback(self, params, button_instance, time)
on_click_outsideOn click outside of button(self, params, button_instance)
nodeTrigger node
anim_nodeAnimation node
start_scaleInitial scale of anim_node
start_posInitial pos of anim_node
posInitial pos of anim_node
paramsParams to click callbacks
hoverDruid hover logic component


@@ -138,7 +173,7 @@
- init(node, callback[, params[, anim_node]]) + init(self, node, callback[, params[, anim_node]])
Component init function @@ -146,8 +181,12 @@

Parameters:

    +
  • self + Button + +
  • node - node + node Gui node
  • callback @@ -160,7 +199,7 @@ (optional)
  • anim_node - node + node Button anim node (node, if not provided) (optional)
  • @@ -173,7 +212,7 @@
- set_enabled(state) + set_enabled(self, state)
Set enabled button component state @@ -181,6 +220,10 @@

Parameters:

    +
  • self + Button + +
  • state bool Enabled state @@ -190,7 +233,7 @@

    Returns:

      - druid.button + Button Current button instance
    @@ -200,12 +243,19 @@
- is_enabled() + is_enabled(self)
Return button enabled state +

Parameters:

+
    +
  • self + Button + +
  • +

Returns:

    @@ -220,7 +270,7 @@
- set_click_zone(zone) + set_click_zone(self, zone)
Strict button click area. Useful for @@ -229,8 +279,12 @@

Parameters:

    +
  • self + Button + +
  • zone - node + node Gui node
@@ -238,7 +292,7 @@

Returns:

    - druid.button + Button Current button instance
@@ -248,7 +302,7 @@
- set_key_trigger(key) + set_key_trigger(self, key)
Set key-code to trigger this button @@ -256,6 +310,10 @@

Parameters:

    +
  • self + Button + +
  • key hash The action_id of the key @@ -265,7 +323,7 @@

    Returns:

      - druid.button + Button Current button instance
    @@ -275,12 +333,19 @@
- get_key_trigger() + get_key_trigger(self)
Get key-code to trigger this button +

Parameters:

+
    +
  • self + Button + +
  • +

Returns:

    @@ -298,100 +363,8 @@
    - - Events -
    -
    - Component events - - -

    Fields:

    -
      -
    • on_click - druid_event - (self, params, button_instance) On release button callback -
    • -
    • on_repeated_click - druid_event - (self, params, buttoninstance, clickamount) On repeated action button callback -
    • -
    • on_long_click - druid_event - (self, params, button_instance, time) On long tap button callback -
    • -
    • on_double_click - druid_event - (self, params, buttoninstance, clickamount) On double tap button callback -
    • -
    • on_hold_callback - druid_event - (self, params, buttoninstance, time) On button hold before longclick callback -
    • -
    • on_click_outside - druid_event - (self, params, button_instance) On click outside of button -
    • -
    - - - - - -
    -
    - - Fields -
    -
    - Component fields - - -

    Fields:

    -
      -
    • node - node - Trigger node -
    • -
    • anim_node - node - Animation node - (default node) -
    • -
    • start_scale - vector3 - Initial scale of anim_node -
    • -
    • start_pos - vector3 - Initial pos of anim_node -
    • -
    • pos - vector3 - Initial pos of anim_node -
    • -
    • params - any - Params to click callbacks -
    • -
    • hover - druid.hover - Druid hover logic component -
    • -
    • click_zone - node - Restriction zone - (optional) -
    • -
    - - - - - -
    -
    - - Style + + style
    Component style params. @@ -403,7 +376,7 @@
    • LONGTAP_TIME number - Minimum time to trigger onholdcallback + Minimum time to trigger on_hold_callback (default 0.4)
    • AUTOHOLD_TRIGGER @@ -442,6 +415,271 @@ +
    +
    +

    Fields

    + +
    +
    + + on_click +
    +
    + On release button callback(self, params, button_instance) + + +
      +
    • on_click + druid_event + +
    • +
    + + + + + +
    +
    + + on_repeated_click +
    +
    + On repeated action button callback(self, params, button_instance, click_amount) + + +
      +
    • on_repeated_click + druid_event + +
    • +
    + + + + + +
    +
    + + on_long_click +
    +
    + On long tap button callback(self, params, button_instance, time) + + +
      +
    • on_long_click + druid_event + +
    • +
    + + + + + +
    +
    + + on_double_click +
    +
    + On double tap button callback(self, params, button_instance, click_amount) + + +
      +
    • on_double_click + druid_event + +
    • +
    + + + + + +
    +
    + + on_hold_callback +
    +
    + On button hold before long_click callback(self, params, button_instance, time) + + +
      +
    • on_hold_callback + druid_event + +
    • +
    + + + + + +
    +
    + + on_click_outside +
    +
    + On click outside of button(self, params, button_instance) + + +
      +
    • on_click_outside + druid_event + +
    • +
    + + + + + +
    +
    + + node +
    +
    + Trigger node + + +
      +
    • node + node + +
    • +
    + + + + + +
    +
    + + anim_node +
    +
    + Animation node + + +
      +
    • anim_node + node + + (default node) +
    • +
    + + + + + +
    +
    + + start_scale +
    +
    + Initial scale of anim_node + + +
      +
    • start_scale + vector3 + +
    • +
    + + + + + +
    +
    + + start_pos +
    +
    + Initial pos of anim_node + + +
      +
    • start_pos + vector3 + +
    • +
    + + + + + +
    +
    + + pos +
    +
    + Initial pos of anim_node + + +
      +
    • pos + vector3 + +
    • +
    + + + + + +
    +
    + + params +
    +
    + Params to click callbacks + + +
      +
    • params + any + +
    • +
    + + + + + +
    +
    + + hover +
    +
    + Druid hover logic component + + +
      +
    • hover + druid.hover + +
    • +
    + + + + +
    @@ -450,7 +688,7 @@
generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 +Last updated 2020-10-12 00:29:49
diff --git a/docs/modules/druid.checkbox.html b/docs/modules/Checkbox.html similarity index 50% rename from docs/modules/druid.checkbox.html rename to docs/modules/Checkbox.html index d432cb6..4da4ed7 100644 --- a/docs/modules/druid.checkbox.html +++ b/docs/modules/Checkbox.html @@ -34,88 +34,83 @@

Modules

-

Topics

-
-

Module druid.checkbox

+

Module Checkbox

Druid checkbox component

-

- -

+

Functions

- + - + - +
init(node, callback[, click=node])init(self, node, callback[, click_node=node]) Component init function
set_state(state, is_silent)set_state(self, state, is_silent) Set checkbox state
get_state()get_state(self) Return checkbox state

Tables

- - - - - - - - - +
EventsComponent events
FieldsComponent fields
Stylestyle Component style params.
+

Fields

+ + + + + + + + + + + + + +
on_change_stateOn change state callback(self, state)
nodeVisual node
click_nodeButton trigger node


@@ -126,7 +121,7 @@
- init(node, callback[, click=node]) + init(self, node, callback[, click_node=node])
Component init function @@ -134,17 +129,21 @@

Parameters:

    +
  • self + Checkbox + +
  • node - node + node Gui node
  • callback function Checkbox callback
  • -
  • click - node - node Trigger node, by default equals to node +
  • click_node + node + Trigger node, by default equals to node (default node)
@@ -156,7 +155,7 @@
- set_state(state, is_silent) + set_state(self, state, is_silent)
Set checkbox state @@ -164,13 +163,17 @@

Parameters:

    +
  • self + Checkbox + +
  • state bool Checkbox state
  • is_silent bool - Don't trigger onchangestate if true + Don't trigger on_change_state if true
@@ -181,12 +184,19 @@
- get_state() + get_state(self)
Return checkbox state +

Parameters:

+
    +
  • self + Checkbox + +
  • +

Returns:

    @@ -204,59 +214,8 @@
    - - Events -
    -
    - Component events - - -

    Fields:

    -
      -
    • on_change_state - druid_event - On change state callback -
    • -
    - - - - - -
    -
    - - Fields -
    -
    - Component fields - - -

    Fields:

    -
      -
    • node - node - Visual node -
    • -
    • click_node - node - Button trigger node - (default node) -
    • -
    • button - druid.button - Button component from click_node -
    • -
    - - - - - -
    -
    - - Style + + style
    Component style params. @@ -276,6 +235,71 @@ +
    +
    +

    Fields

    + +
    +
    + + on_change_state +
    +
    + On change state callback(self, state) + + +
      +
    • on_change_state + druid_event + +
    • +
    + + + + + +
    +
    + + node +
    +
    + Visual node + + +
      +
    • node + node + +
    • +
    + + + + + +
    +
    + + click_node +
    +
    + Button trigger node + + +
      +
    • click_node + node + + (default node) +
    • +
    + + + + +
    @@ -284,7 +308,7 @@
generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 +Last updated 2020-10-12 00:29:49
diff --git a/docs/modules/CheckboxGroup.html b/docs/modules/CheckboxGroup.html new file mode 100644 index 0000000..56349db --- /dev/null +++ b/docs/modules/CheckboxGroup.html @@ -0,0 +1,227 @@ + + + + + Defold Druid UI Library + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module CheckboxGroup

+

Checkbox group module

+

+ + +

Functions

+ + + + + + + + + + + + + +
init(self, nodes, callback[, click_nodes=node])Component init function
set_state(self, indexes)Set checkbox group state
get_state(self)Return checkbox group state
+

Fields

+ + + + + +
on_checkbox_clickOn any checkbox click callback(self, index)
+ +
+
+ + +

Functions

+ +
+
+ + init(self, nodes, callback[, click_nodes=node]) +
+
+ Component init function + + +

Parameters:

+
    +
  • self + CheckboxGroup + +
  • +
  • nodes + node[] + Array of gui node +
  • +
  • callback + function + Checkbox callback +
  • +
  • click_nodes + node[] + Array of trigger nodes, by default equals to nodes + (default node) +
  • +
+ + + + + +
+
+ + set_state(self, indexes) +
+
+ Set checkbox group state + + +

Parameters:

+
    +
  • self + CheckboxGroup + +
  • +
  • indexes + bool[] + Array of checkbox state +
  • +
+ + + + + +
+
+ + get_state(self) +
+
+ Return checkbox group state + + +

Parameters:

+
    +
  • self + CheckboxGroup + +
  • +
+ +

Returns:

+
    + + bool[] + Array if checkboxes state +
+ + + + +
+
+

Fields

+ +
+
+ + on_checkbox_click +
+
+ On any checkbox click callback(self, index) + + +
    +
  • on_checkbox_click + druid_event + +
  • +
+ + + + + +
+
+ + +
+
+
+generated by LDoc 1.4.6 +Last updated 2020-10-12 00:29:49 +
+
+ + diff --git a/docs/modules/Drag.html b/docs/modules/Drag.html new file mode 100644 index 0000000..48b4c68 --- /dev/null +++ b/docs/modules/Drag.html @@ -0,0 +1,471 @@ + + + + + Defold Druid UI Library + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module Drag

+

Component to handle drag action on node.

+

+ Drag have correct handling for multitouch and swap + touched while dragging. Drag will be processed even + the cursor is outside of node, if drag is already started

+ + +

Functions

+ + + + + + + + + +
init(self, node, on_drag_callback)Drag component constructor
set_click_zone(self, zone)Strict drag click area.
+

Tables

+ + + + + +
styleComponent style params.
+

Fields

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
on_touch_startEvent on touch start callback(self)
on_touch_endEvent on touch end callback(self)
on_drag_startEvent on drag start callback(self)
on_dragon drag progress callback(self, dx, dy)
on_drag_endEvent on drag end callback(self)
is_touchIs component now touching
is_dragIs component now dragging
can_xIs drag component process vertical dragging.
can_yIs drag component process horizontal.
xCurrent touch x position
yCurrent touch y position
+ +
+
+ + +

Functions

+ +
+
+ + init(self, node, on_drag_callback) +
+
+ Drag component constructor + + +

Parameters:

+
    +
  • self + Drag + +
  • +
  • node + node + GUI node to detect dragging +
  • +
  • on_drag_callback + function + Callback for on_drag_event(self, dx, dy) +
  • +
+ + + + + +
+
+ + set_click_zone(self, zone) +
+
+ Strict drag click area. Useful for + restrict events outside stencil node + + +

Parameters:

+
    +
  • self + Drag + +
  • +
  • zone + node + Gui node +
  • +
+ + + + + +
+
+

Tables

+ +
+
+ + style +
+
+ Component style params. + You can override this component styles params in druid styles table + or create your own style + + +

Fields:

+
    +
  • DRAG_DEADZONE + number + Distance in pixels to start dragging + (default 10) +
  • +
+ + + + + +
+
+

Fields

+ +
+
+ + on_touch_start +
+
+ Event on touch start callback(self) + + +
    +
  • on_touch_start + druid_event + +
  • +
+ + + + + +
+
+ + on_touch_end +
+
+ Event on touch end callback(self) + + +
    +
  • on_touch_end + druid_event + +
  • +
+ + + + + +
+
+ + on_drag_start +
+
+ Event on drag start callback(self) + + +
    +
  • on_drag_start + druid_event + +
  • +
+ + + + + +
+
+ + on_drag +
+
+ on drag progress callback(self, dx, dy) + + +
    +
  • on_drag + druid_event + Event +
  • +
+ + + + + +
+
+ + on_drag_end +
+
+ Event on drag end callback(self) + + +
    +
  • on_drag_end + druid_event + +
  • +
+ + + + + +
+
+ + is_touch +
+
+ Is component now touching + + +
    +
  • is_touch + bool + +
  • +
+ + + + + +
+
+ + is_drag +
+
+ Is component now dragging + + +
    +
  • is_drag + bool + +
  • +
+ + + + + +
+
+ + can_x +
+
+ Is drag component process vertical dragging. Default - true + + +
    +
  • can_x + bool + +
  • +
+ + + + + +
+
+ + can_y +
+
+ Is drag component process horizontal. Default - true + + +
    +
  • can_y + bool + +
  • +
+ + + + + +
+
+ + x +
+
+ Current touch x position + + +
    +
  • x + number + +
  • +
+ + + + + +
+
+ + y +
+
+ Current touch y position + + +
    +
  • y + number + +
  • +
+ + + + + +
+
+ + +
+
+
+generated by LDoc 1.4.6 +Last updated 2020-10-12 00:29:49 +
+
+ + diff --git a/docs/modules/druid_event.html b/docs/modules/DruidEvent.html similarity index 50% rename from docs/modules/druid_event.html rename to docs/modules/DruidEvent.html index ecc8a58..c5c7859 100644 --- a/docs/modules/druid_event.html +++ b/docs/modules/DruidEvent.html @@ -38,77 +38,64 @@

Modules

-

Topics

-
-

Module druid_event

+

Module DruidEvent

Lua event small library

-

- -

+

Functions

- + - + - + - + - + - +
Event(initial_callback)initialize(self, initial_callback) Event constructur
event:subscribe(callback)subscribe(self, callback) Subscribe callback on event
event:unsubscribe(callback)unsubscribe(self, callback) Unsubscribe callback on event
event:is_exist()is_exist(self) Return true, if event have at lease one handler
event:clear()clear(self) Clear the all event handlers
event:trigger(...)trigger(self, ...) Trigger the event and call all subscribed callbacks
@@ -121,8 +108,8 @@
- - Event(initial_callback) + + initialize(self, initial_callback)
Event constructur @@ -130,6 +117,10 @@

Parameters:

    +
  • self + DruidEvent + +
  • initial_callback function Subscribe the callback on new event, if callback exist @@ -142,8 +133,8 @@
- - event:subscribe(callback) + + subscribe(self, callback)
Subscribe callback on event @@ -151,6 +142,10 @@

Parameters:

    +
  • self + DruidEvent + +
  • callback function Callback itself @@ -163,8 +158,8 @@
- - event:unsubscribe(callback) + + unsubscribe(self, callback)
Unsubscribe callback on event @@ -172,6 +167,10 @@

Parameters:

    +
  • self + DruidEvent + +
  • callback function Callback itself @@ -184,13 +183,20 @@
- - event:is_exist() + + is_exist(self)
Return true, if event have at lease one handler +

Parameters:

+
    +
  • self + DruidEvent + +
  • +

Returns:

    @@ -204,13 +210,20 @@
- - event:clear() + + clear(self)
Clear the all event handlers +

Parameters:

+
    +
  • self + DruidEvent + +
  • +
@@ -218,8 +231,8 @@
- - event:trigger(...) + + trigger(self, ...)
Trigger the event and call all subscribed callbacks @@ -227,7 +240,12 @@

Parameters:

    +
  • self + DruidEvent + +
  • ... + any All event params
@@ -244,7 +262,7 @@
generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 +Last updated 2020-10-12 00:29:49
diff --git a/docs/modules/DruidInstance.html b/docs/modules/DruidInstance.html new file mode 100644 index 0000000..2a79cd2 --- /dev/null +++ b/docs/modules/DruidInstance.html @@ -0,0 +1,1110 @@ + + + + + Defold Druid UI Library + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module DruidInstance

+

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:

+ + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
initialize(self, context, style)Druid class constructor
create(self, component, ...)Create new druid component
final(self)Call on final function on gui_script.
remove(self, component)Remove component from druid instance.
update(self, dt)Druid update function
on_input(self, action_id, action)Druid on_input function
on_message(self, message_id, message, sender)Druid on_message function
on_focus_lost(self)Druid on focus lost interest function.
on_focus_gained(self)Druid on focus gained interest function.
on_layout_change(self)Druid on layout change function.
druid.on_language_change()Druid on language change.
new_button(self, ...)Create button basic component
new_blocker(self, ...)Create blocker basic component
new_back_handler(self, ...)Create back_handler basic component
new_hover(self, ...)Create hover basic component
new_text(self, ...)Create text basic component
new_grid(self, ...)Create grid basic component + Deprecated
new_static_grid(self, ...)Create static grid basic component
new_scroll(self, ...)Create scroll basic component
new_swipe(self, ...)Create swipe basic component
new_drag(self, ...)Create drag basic component
new_dynamic_grid(self, ...)Create dynamic grid component
new_lang_text(self, ...)Create lang_text component
new_slider(self, ...)Create slider component
new_checkbox(self, ...)Create checkbox component
new_input(self, ...)Create input component
new_checkbox_group(self, ...)Create checkbox_group component
new_radio_group(self, ...)Create radio_group component
new_timer(self, ...)Create timer component
new_progress(self, ...)Create progress component
+ +
+
+ + +

Functions

+ +
+
+ + initialize(self, context, style) +
+
+ Druid class constructor + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • context + table + Druid context. Usually it is self of script +
  • +
  • style + table + Druid style module +
  • +
+ + + + + +
+
+ + create(self, component, ...) +
+
+ Create new druid component + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • component + Component + Component module +
  • +
  • ... + args + Other component params to pass it to component:init function +
  • +
+ + + + + +
+
+ + final(self) +
+
+ Call on final function on gui_script. It will call on_remove + on all druid components + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
+ + + + + +
+
+ + remove(self, component) +
+
+ Remove component from druid instance. + Component `on_remove` function will be invoked, if exist. + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • component + Component + Component instance +
  • +
+ + + + + +
+
+ + update(self, dt) +
+
+ Druid update function + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • dt + number + Delta time +
  • +
+ + + + + +
+
+ + on_input(self, action_id, action) +
+
+ Druid on_input function + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • action_id + hash + Action_id from on_input +
  • +
  • action + table + Action from on_input +
  • +
+ + + + + +
+
+ + on_message(self, message_id, message, sender) +
+
+ Druid on_message function + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • message_id + hash + Message_id from on_message +
  • +
  • message + table + Message from on_message +
  • +
  • sender + hash + Sender from on_message +
  • +
+ + + + + +
+
+ + on_focus_lost(self) +
+
+ Druid on focus lost interest function. + This one called by on_window_callback by global window listener + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
+ + + + + +
+
+ + on_focus_gained(self) +
+
+ Druid on focus gained interest function. + This one called by on_window_callback by global window listener + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
+ + + + + +
+
+ + on_layout_change(self) +
+
+ Druid on layout change function. + Called on update gui layout + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
+ + + + + +
+
+ + druid.on_language_change() +
+
+ Druid on language change. + This one called by global gruid.on_language_change, but can be + call manualy to update all translations + + + + + + + +
+
+ + new_button(self, ...) +
+
+ Create button basic component + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • ... + args + button init args +
  • +
+ +

Returns:

+
    + + Button + button component +
+ + + + +
+
+ + new_blocker(self, ...) +
+
+ Create blocker basic component + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • ... + args + blocker init args +
  • +
+ +

Returns:

+
    + + Blocker + blocker component +
+ + + + +
+
+ + new_back_handler(self, ...) +
+
+ Create back_handler basic component + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • ... + args + back_handler init args +
  • +
+ +

Returns:

+
    + + BackHandler + back_handler component +
+ + + + +
+
+ + new_hover(self, ...) +
+
+ Create hover basic component + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • ... + args + hover init args +
  • +
+ +

Returns:

+
    + + Hover + hover component +
+ + + + +
+
+ + new_text(self, ...) +
+
+ Create text basic component + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • ... + args + text init args +
  • +
+ +

Returns:

+
    + + Tet + text component +
+ + + + +
+
+ + new_grid(self, ...) +
+
+ Create grid basic component + Deprecated + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • ... + args + grid init args +
  • +
+ +

Returns:

+
    + + StaticGrid + grid component +
+ + + + +
+
+ + new_static_grid(self, ...) +
+
+ Create static grid basic component + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • ... + args + grid init args +
  • +
+ +

Returns:

+
    + + StaticGrid + grid component +
+ + + + +
+
+ + new_scroll(self, ...) +
+
+ Create scroll basic component + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • ... + args + scroll init args +
  • +
+ +

Returns:

+
    + + Scroll + scroll component +
+ + + + +
+
+ + new_swipe(self, ...) +
+
+ Create swipe basic component + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • ... + args + swipe init args +
  • +
+ +

Returns:

+
    + + Swipe + swipe component +
+ + + + +
+
+ + new_drag(self, ...) +
+
+ Create drag basic component + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • ... + args + drag init args +
  • +
+ +

Returns:

+
    + + Drag + drag component +
+ + + + +
+
+ + new_dynamic_grid(self, ...) +
+
+ Create dynamic grid component + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • ... + args + grid init args +
  • +
+ +

Returns:

+
    + + DynamicGrid + grid component +
+ + + + +
+
+ + new_lang_text(self, ...) +
+
+ Create lang_text component + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • ... + args + lang_text init args +
  • +
+ +

Returns:

+
    + + LangText + lang_text component +
+ + + + +
+
+ + new_slider(self, ...) +
+
+ Create slider component + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • ... + args + slider init args +
  • +
+ +

Returns:

+
    + + Slider + slider component +
+ + + + +
+
+ + new_checkbox(self, ...) +
+
+ Create checkbox component + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • ... + args + checkbox init args +
  • +
+ +

Returns:

+
    + + Checkbox + checkbox component +
+ + + + +
+
+ + new_input(self, ...) +
+
+ Create input component + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • ... + args + input init args +
  • +
+ +

Returns:

+
    + + Input + input component +
+ + + + +
+
+ + new_checkbox_group(self, ...) +
+
+ Create checkbox_group component + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • ... + args + checkbox_group init args +
  • +
+ +

Returns:

+
    + + CheckboxGroup + checkbox_group component +
+ + + + +
+
+ + new_radio_group(self, ...) +
+
+ Create radio_group component + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • ... + args + radio_group init args +
  • +
+ +

Returns:

+
    + + RadioGroup + radio_group component +
+ + + + +
+
+ + new_timer(self, ...) +
+
+ Create timer component + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • ... + args + timer init args +
  • +
+ +

Returns:

+
    + + Timer + timer component +
+ + + + +
+
+ + new_progress(self, ...) +
+
+ Create progress component + + +

Parameters:

+
    +
  • self + DruidInstance + +
  • +
  • ... + args + progress init args +
  • +
+ +

Returns:

+
    + + Progress + progress component +
+ + + + +
+
+ + +
+
+
+generated by LDoc 1.4.6 +Last updated 2020-10-12 00:29:49 +
+
+ + diff --git a/docs/modules/druid.dynamic_grid.html b/docs/modules/DynamicGrid.html similarity index 53% rename from docs/modules/druid.dynamic_grid.html rename to docs/modules/DynamicGrid.html index 1bc6a53..34e4ad6 100644 --- a/docs/modules/druid.dynamic_grid.html +++ b/docs/modules/DynamicGrid.html @@ -33,111 +33,130 @@

Contents

Modules

-

Topics

-
-

Module druid.dynamic_grid

+

Module DynamicGrid

Component to handle placing components in row

-

- -

+

Functions

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

Tables

+

Fields

- - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EventsComponent eventson_add_itemOn item add callback(self, node, index)
FieldsComponent fieldson_remove_itemOn item remove callback(self, index)
on_change_itemsOn item add or remove callback(self, index)
on_clearOn grid clear callback(self)
on_update_positionsOn update item positions callback(self)
parentParent gui node
nodesList of all grid nodes
first_indexThe first index of node in grid
last_indexThe last index of node in grid
node_sizeItem size
@@ -150,7 +169,7 @@
- init(parent) + init(self, parent)
Component init function @@ -158,6 +177,10 @@

Parameters:

    +
  • self + DynamicGrid + +
  • parent node The gui node parent, where items will be placed @@ -171,7 +194,7 @@
- get_pos(index, node) + get_pos(self, index, node[, origin_index])
Return pos for grid node index @@ -179,6 +202,10 @@

Parameters:

    +
  • self + DynamicGrid + +
  • index number The grid element index @@ -187,6 +214,11 @@ node The node to be placed
  • +
  • origin_index + number + Index of nearby node + (optional) +

Returns:

@@ -202,7 +234,7 @@
- add(node[, index[, is_shift_left=false]]) + add(self, node[, index[, is_shift_left=false]])
Add new node to the grid @@ -210,6 +242,10 @@

Parameters:

    +
  • self + DynamicGrid + +
  • node node Gui node @@ -233,7 +269,7 @@
- remove(index[, is_shift_left=false]) + remove(self, index[, is_shift_left=false])
Remove the item from the grid. Note that gui node will be not deleted @@ -241,6 +277,10 @@

Parameters:

    +
  • self + DynamicGrid + +
  • index number The grid node index to remove @@ -259,12 +299,23 @@
- get_size() + get_size(self, border)
Return grid content size +

Parameters:

+
    +
  • self + DynamicGrid + +
  • +
  • border + vector3 + +
  • +

Returns:

    @@ -279,7 +330,7 @@
- get_index_by_node(node) + get_index_by_node(self, node)
Return grid index by node @@ -287,6 +338,10 @@

Parameters:

    +
  • self + DynamicGrid + +
  • node node The gui node in the grid @@ -306,12 +361,19 @@
- get_all_pos() + get_all_pos(self)
Return array of all node positions +

Parameters:

+
    +
  • self + DynamicGrid + +
  • +

Returns:

    @@ -326,7 +388,7 @@
- set_position_function(callback) + set_position_function(self, callback)
Change set position function for grid nodes. It will call on @@ -335,6 +397,10 @@

Parameters:

    +
  • self + DynamicGrid + +
  • callback function Function on node set position @@ -354,13 +420,20 @@
- clear() + clear(self)
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 +

Parameters:

+
    +
  • self + DynamicGrid + +
  • +

Returns:

    @@ -374,8 +447,8 @@
- - DynamicGrid:_get_side_vector(side, is_forward) + + _get_side_vector(self, side, is_forward)
Return side vector to correct node shifting @@ -383,15 +456,14 @@

Parameters:

    +
  • self + +
  • side - -
  • is_forward - -
@@ -401,38 +473,21 @@
-

Tables

+

Fields

- - Events + + on_add_item
- Component events + On item add callback(self, node, index) -

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 +
@@ -442,38 +497,177 @@
- - Fields + + on_remove_item
- Component fields + On item remove callback(self, index) + + +
    +
  • on_remove_item + druid_event + +
  • +
+ + + + + +
+
+ + on_change_items +
+
+ On item add or remove callback(self, index) + + +
    +
  • on_change_items + druid_event + +
  • +
+ + + + + +
+
+ + on_clear +
+
+ On grid clear callback(self) + + +
    +
  • on_clear + druid_event + +
  • +
+ + + + + +
+
+ + on_update_positions +
+
+ On update item positions callback(self) + + +
    +
  • on_update_positions + druid_event + +
  • +
+ + + + + +
+
+ + parent +
+
+ Parent gui node -

Fields:

  • parent node - Parent gui node +
  • +
+ + + + + +
+
+ + nodes +
+
+ List of all grid nodes + + +
  • nodes node[] - List of all grid nodes +
  • +
+ + + + + +
+
+ + first_index +
+
+ The first index of node in grid + + +
  • first_index number - The first index of node in grid +
  • +
+ + + + + +
+
+ + last_index +
+
+ The last index of node in grid + + +
  • last_index number - The last index of node in grid +
  • +
+ + + + + +
+
+ + node_size +
+
+ Item size + + +
  • node_size vector3 - Item size -
  • -
  • border - vector4 - The size of item content +
@@ -489,7 +683,7 @@
generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 +Last updated 2020-10-12 00:29:49
diff --git a/docs/modules/druid.hover.html b/docs/modules/Hover.html similarity index 56% rename from docs/modules/druid.hover.html rename to docs/modules/Hover.html index 7115172..28dde66 100644 --- a/docs/modules/druid.hover.html +++ b/docs/modules/Hover.html @@ -33,91 +33,78 @@

Contents

Modules

-

Topics

-
-

Module druid.hover

+

Module Hover

Component to handle hover node interaction

-

- -

+

Functions

- + - + - + - + - + - +
init(node, on_hover_callback)init(self, node, on_hover_callback) Component init function
set_hover(state)set_hover(self, state) Set hover state
set_mouse_hover(state)set_mouse_hover(self, state) Set mouse hover state
set_click_zone(zone)set_click_zone(self, zone) Strict hover click area.
set_enabled(state)set_enabled(self, state) Set enable state of hover component.
is_enabled()is_enabled(self) Return current hover enabled state
-

Tables

+

Fields

- - + +
EventsComponent eventson_hoverOn hover callback(self, state)
@@ -130,7 +117,7 @@
- init(node, on_hover_callback) + init(self, node, on_hover_callback)
Component init function @@ -138,6 +125,10 @@

Parameters:

    +
  • self + Hover + +
  • node node Gui node @@ -155,7 +146,7 @@
- set_hover(state) + set_hover(self, state)
Set hover state @@ -163,6 +154,10 @@

Parameters:

    +
  • self + Hover + +
  • state bool The hover state @@ -176,7 +171,7 @@
- set_mouse_hover(state) + set_mouse_hover(self, state)
Set mouse hover state @@ -184,6 +179,10 @@

Parameters:

    +
  • self + Hover + +
  • state bool The mouse hover state @@ -197,7 +196,7 @@
- set_click_zone(zone) + set_click_zone(self, zone)
Strict hover click area. Useful for @@ -206,6 +205,10 @@

Parameters:

    +
  • self + Hover + +
  • zone node Gui node @@ -219,7 +222,7 @@
- set_enabled(state) + set_enabled(self, state)
Set enable state of hover component. @@ -229,6 +232,10 @@

Parameters:

    +
  • self + Hover + +
  • state bool The hover enabled state @@ -242,12 +249,19 @@
- is_enabled() + is_enabled(self)
Return current hover enabled state +

Parameters:

+
    +
  • self + Hover + +
  • +

Returns:

    @@ -261,26 +275,21 @@
-

Tables

+

Fields

- - Events + + on_hover
- Component events + On hover callback(self, state) -

Fields:

  • on_hover druid_event - On hover callback (Touch pressed) -
  • -
  • on_mouse_hover - druid_event - On mouse hover callback (Touch over without action_id) +
@@ -296,7 +305,7 @@
generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 +Last updated 2020-10-12 00:29:49
diff --git a/docs/modules/druid.input.html b/docs/modules/Input.html similarity index 53% rename from docs/modules/druid.input.html rename to docs/modules/Input.html index d8292b2..d5746c4 100644 --- a/docs/modules/druid.input.html +++ b/docs/modules/Input.html @@ -34,54 +34,45 @@

Modules

-

Topics

-
-

Module druid.input

+

Module Input

Druid input text component.

-

Carry on user text input

+

+ Carry on user text input

Info:

generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 +Last updated 2020-10-12 00:29:49
diff --git a/docs/modules/druid.lang_text.html b/docs/modules/LangText.html similarity index 50% rename from docs/modules/druid.lang_text.html rename to docs/modules/LangText.html index a5d6b07..c95f524 100644 --- a/docs/modules/druid.lang_text.html +++ b/docs/modules/LangText.html @@ -33,84 +33,67 @@

Contents

Modules

-

Topics

-
-

Module druid.lang_text

+

Module LangText

Component to handle all GUI texts Good working with localization system

-

- -

+

Functions

- + - + - +
init(node, locale_id, no_adjust)init(self, node, locale_id, no_adjust) Component init function
set_to(text)set_to(self, text) Setup raw text to lang_text component
translate(locale_id)translate(self, locale_id) Translate the text by locale_id
-

Tables

+

Fields

- - - - - - + +
EventsComponent events
FieldsComponent fieldson_changeOn change text callback
@@ -123,7 +106,7 @@
- init(node, locale_id, no_adjust) + init(self, node, locale_id, no_adjust)
Component init function @@ -131,6 +114,10 @@

Parameters:

    +
  • self + LangText + +
  • node node The text node @@ -152,7 +139,7 @@
- set_to(text) + set_to(self, text)
Setup raw text to lang_text component @@ -160,6 +147,10 @@

Parameters:

    +
  • self + LangText + +
  • text string Text for text node @@ -173,7 +164,7 @@
- translate(locale_id) + translate(self, locale_id)
Translate the text by locale_id @@ -181,6 +172,10 @@

Parameters:

    +
  • self + LangText + +
  • locale_id string Locale id @@ -193,43 +188,21 @@
-

Tables

+

Fields

- - Events + + on_change
- Component events + On change text callback -

Fields:

  • on_change druid_event - On change text callback -
  • -
- - - - -
-
- - Fields -
-
- Component fields - - -

Fields:

-
    -
  • text - druid.text - The text component
@@ -245,7 +218,7 @@
generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 +Last updated 2020-10-12 00:29:49
diff --git a/docs/modules/druid.progress.html b/docs/modules/Progress.html similarity index 55% rename from docs/modules/druid.progress.html rename to docs/modules/Progress.html index 1f70c03..1b4a333 100644 --- a/docs/modules/druid.progress.html +++ b/docs/modules/Progress.html @@ -34,102 +34,112 @@

Modules

-

Topics

-
-

Module druid.progress

+

Module Progress

Basic progress bar component.

-

For correct progress bar init it should be in max size from gui

+

+ For correct progress bar init it should be in max size from gui

Functions

- + - + - + - + - + - + - +
init(node, key[, init_value=1])init(self, node, key[, init_value=1]) Component init function
fill()fill(self) Fill a progress bar and stop progress animation
empty()empty(self) Empty a progress bar
set_to(to)set_to(self, to) Instant fill progress bar to value
get()get(self) Return current progress bar value
set_steps(steps, callback)set_steps(self, steps, callback) Set points on progress bar to fire the callback
to(to[, callback])to(self, to[, callback]) Start animation of a progress bar

Tables

- - - - - - - - - +
EventsComponent events
FieldsComponent fields
Stylestyle Component style params.
+

Fields

+ + + + + + + + + + + + + + + + + + + + + + + + + +
on_changeOn progress bar change callback(self, new_value)
nodeProgress bar fill node
keyThe progress bar direction
scaleCurrent progress bar scale
sizeCurrent progress bar size
max_sizeMaximum size of progress bar


@@ -140,7 +150,7 @@
- init(node, key[, init_value=1]) + init(self, node, key[, init_value=1])
Component init function @@ -148,8 +158,12 @@

Parameters:

    +
  • self + Progress + +
  • node - string or node + string or node Progress bar fill node or node name
  • key @@ -170,12 +184,19 @@
- fill() + fill(self)
Fill a progress bar and stop progress animation +

Parameters:

+
    +
  • self + Progress + +
  • +
@@ -184,12 +205,19 @@
- empty() + empty(self)
Empty a progress bar +

Parameters:

+
    +
  • self + Progress + +
  • +
@@ -198,7 +226,7 @@
- set_to(to) + set_to(self, to)
Instant fill progress bar to value @@ -206,6 +234,10 @@

Parameters:

    +
  • self + Progress + +
  • to number Progress bar value, from 0 to 1 @@ -219,12 +251,19 @@
- get() + get(self)
Return current progress bar value +

Parameters:

+
    +
  • self + Progress + +
  • +
@@ -233,7 +272,7 @@
- set_steps(steps, callback) + set_steps(self, steps, callback)
Set points on progress bar to fire the callback @@ -241,6 +280,10 @@

Parameters:

    +
  • self + Progress + +
  • steps number[] Array of progress bar values @@ -262,7 +305,7 @@
- to(to[, callback]) + to(self, to[, callback])
Start animation of a progress bar @@ -270,6 +313,10 @@

Parameters:

    +
  • self + Progress + +
  • to number value between 0..1 @@ -291,70 +338,8 @@
    - - Events -
    -
    - Component events - - -

    Fields:

    -
      -
    • on_change - druid_event - On progress bar change callback -
    • -
    - - - - - -
    -
    - - Fields -
    -
    - Component fields - - -

    Fields:

    -
      -
    • node - node - Progress bar fill node -
    • -
    • key - string - The progress bar direction -
    • -
    • scale - vector3 - Current progress bar scale -
    • -
    • size - vector3 - Current progress bar size -
    • -
    • max_size - number - Maximum size of progress bar -
    • -
    • slice - vector4 - Progress bar slice9 settings -
    • -
    - - - - - -
    -
    - - Style + + style
    Component style params. @@ -380,6 +365,130 @@ +
    +
    +

    Fields

    + +
    +
    + + on_change +
    +
    + On progress bar change callback(self, new_value) + + +
      +
    • on_change + druid_event + +
    • +
    + + + + + +
    +
    + + node +
    +
    + Progress bar fill node + + +
      +
    • node + node + +
    • +
    + + + + + +
    +
    + + key +
    +
    + The progress bar direction + + + + + + + + +
    +
    + + scale +
    +
    + Current progress bar scale + + +
      +
    • scale + vector3 + +
    • +
    + + + + + +
    +
    + + size +
    +
    + Current progress bar size + + +
      +
    • size + vector3 + +
    • +
    + + + + + +
    +
    + + max_size +
    +
    + Maximum size of progress bar + + +
      +
    • max_size + number + +
    • +
    + + + + +
    @@ -388,7 +497,7 @@
generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 +Last updated 2020-10-12 00:29:49
diff --git a/docs/modules/RadioGroup.html b/docs/modules/RadioGroup.html new file mode 100644 index 0000000..5c3a04c --- /dev/null +++ b/docs/modules/RadioGroup.html @@ -0,0 +1,227 @@ + + + + + Defold Druid UI Library + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module RadioGroup

+

Radio group module

+

+ + +

Functions

+ + + + + + + + + + + + + +
init(self, nodes, callback[, click_nodes=node])Component init function
set_state(self, index)Set radio group state
get_state(self)Return radio group state
+

Fields

+ + + + + +
on_radio_clickOn any checkbox click
+ +
+
+ + +

Functions

+ +
+
+ + init(self, nodes, callback[, click_nodes=node]) +
+
+ Component init function + + +

Parameters:

+
    +
  • self + RadioGroup + +
  • +
  • nodes + node[] + Array of gui node +
  • +
  • callback + function + Radio callback +
  • +
  • click_nodes + node[] + Array of trigger nodes, by default equals to nodes + (default node) +
  • +
+ + + + + +
+
+ + set_state(self, index) +
+
+ Set radio group state + + +

Parameters:

+
    +
  • self + RadioGroup + +
  • +
  • index + number + Index in radio group +
  • +
+ + + + + +
+
+ + get_state(self) +
+
+ Return radio group state + + +

Parameters:

+
    +
  • self + RadioGroup + +
  • +
+ +

Returns:

+
    + + number + Index in radio group +
+ + + + +
+
+

Fields

+ +
+
+ + on_radio_click +
+
+ On any checkbox click + + +
    +
  • on_radio_click + druid_event + +
  • +
+ + + + + +
+
+ + +
+
+
+generated by LDoc 1.4.6 +Last updated 2020-10-12 00:29:49 +
+
+ + diff --git a/docs/modules/druid.scroll.html b/docs/modules/Scroll.html similarity index 58% rename from docs/modules/druid.scroll.html rename to docs/modules/Scroll.html index 5410563..b6932b3 100644 --- a/docs/modules/druid.scroll.html +++ b/docs/modules/Scroll.html @@ -34,54 +34,45 @@

Modules

-

Topics

-
-

Module druid.scroll

+

Module Scroll

Component to handle scroll content.

-

Scroll consist from two nodes: scroll parent and scroll input +

+ Scroll consist from two nodes: scroll parent and scroll input Scroll input the user input zone, it's static Scroll parent the scroll moving part, it will change position. Setup initial scroll size by changing scroll parent size. If scroll parent @@ -92,82 +83,129 @@

Functions

- - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
init(view_node, content_node)Scroll constructor.init(self, view_node, content_node)Scroll constructor
scroll_to(vector3[, is_instant])scroll_to(self, point[, is_instant]) Start scroll to target point.
scroll_to_index(index[, skip_cb])scroll_to_index(self, index[, skip_cb]) Scroll to item in scroll by point index.
scroll_to_percent(vector3[, is_instant])scroll_to_percent(self, percent[, is_instant]) Start scroll to target scroll percent
get_percent()get_percent(self) Return current scroll progress status.
set_size(size)set_size(self, size) Set scroll content size.
set_inert(state)set_inert(self, state) Enable or disable scroll inert.
is_inert()is_inert(self) Return if scroll have inertion.
set_extra_stretch_size([stretch_size=0])set_extra_stretch_size(self[, stretch_size=0]) Set extra size for scroll stretching.
get_scroll_size()get_scroll_size(self) Return vector of scroll size with width and height.
set_points(points)set_points(self, points) Set points of interest.
set_horizontal_scroll(state)set_horizontal_scroll(self, state) Lock or unlock horizontal scroll
set_vertical_scroll(state)set_vertical_scroll(self, state) Lock or unlock vertical scroll
bind_grid(Druid)bind_grid(self, grid) Bind the grid component (Static or Dynamic) to recalculate scroll size on grid changes
Scroll:_cancel_animate()_cancel_animate(self) Cancel animation on other animation or input touch

Tables

- - - - - - - - - +
EventsComponent events
FieldsComponent fields
Stylestyle Component style params.
+

Fields

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
on_scrollOn scroll move callback(self, position)
on_scroll_toOn scroll_to function callback(self, target, is_instant)
on_point_scrollOn scroll_to_index function callback(self, index, point)
view_nodeScroll view node
content_nodeScroll content node
is_inertFlag, if scroll now moving by inertion
inertionCurrent inert speed
positionCurrent scroll posisition
target_positionCurrent scroll target position
available_posAvailable position for content node: (min_x, max_y, max_x, min_y)
available_sizeSize of available positions: (width, height, 0)
dragDrag Druid component
selectedCurrent index of points of interests


@@ -178,14 +216,18 @@
- init(view_node, content_node) + init(self, view_node, content_node)
- Scroll constructor. + Scroll constructor

Parameters:

    +
  • self + Scroll + +
  • view_node node GUI view scroll node @@ -203,7 +245,7 @@
- scroll_to(vector3[, is_instant]) + scroll_to(self, point[, is_instant])
Start scroll to target point. @@ -211,8 +253,12 @@

Parameters:

    -
  • vector3 - point +
  • self + Scroll + +
  • +
  • point + vector3 Target point
  • is_instant @@ -234,7 +280,7 @@
- scroll_to_index(index[, skip_cb]) + scroll_to_index(self, index[, skip_cb])
Scroll to item in scroll by point index. @@ -242,6 +288,10 @@

Parameters:

    +
  • self + Scroll + +
  • index number Point index @@ -260,7 +310,7 @@
- scroll_to_percent(vector3[, is_instant]) + scroll_to_percent(self, percent[, is_instant])
Start scroll to target scroll percent @@ -268,8 +318,12 @@

Parameters:

    -
  • vector3 - point +
  • self + Scroll + +
  • +
  • percent + vector3 target percent
  • is_instant @@ -290,13 +344,20 @@
- get_percent() + get_percent(self)
Return current scroll progress status. Values will be in [0..1] interval +

Parameters:

+
    +
  • self + Scroll + +
  • +

Returns:

    @@ -311,7 +372,7 @@
- set_size(size) + set_size(self, size)
Set scroll content size. @@ -320,6 +381,10 @@

Parameters:

    +
  • self + Scroll + +
  • size vector3 The new size for content node @@ -339,7 +404,7 @@
- set_inert(state) + set_inert(self, state)
Enable or disable scroll inert. @@ -349,6 +414,10 @@

Parameters:

    +
  • self + Scroll + +
  • state bool Inert scroll state @@ -368,12 +437,19 @@
- is_inert() + is_inert(self)
Return if scroll have inertion. +

Parameters:

+
    +
  • self + Scroll + +
  • +

Returns:

    @@ -388,7 +464,7 @@
- set_extra_stretch_size([stretch_size=0]) + set_extra_stretch_size(self[, stretch_size=0])
Set extra size for scroll stretching. @@ -397,6 +473,10 @@

Parameters:

    +
  • self + Scroll + +
  • stretch_size number Size in pixels of additional scroll area @@ -417,12 +497,19 @@
- get_scroll_size() + get_scroll_size(self)
Return vector of scroll size with width and height. +

Parameters:

+
    +
  • self + Scroll + +
  • +

Returns:

    @@ -437,7 +524,7 @@
- set_points(points) + set_points(self, points)
Set points of interest. @@ -446,6 +533,10 @@

Parameters:

    +
  • self + Scroll + +
  • points table Array of vector3 points @@ -465,7 +556,7 @@
- set_horizontal_scroll(state) + set_horizontal_scroll(self, state)
Lock or unlock horizontal scroll @@ -473,6 +564,10 @@

Parameters:

    +
  • self + Scroll + +
  • state bool True, if horizontal scroll is enabled @@ -492,7 +587,7 @@
- set_vertical_scroll(state) + set_vertical_scroll(self, state)
Lock or unlock vertical scroll @@ -500,6 +595,10 @@

Parameters:

    +
  • self + Scroll + +
  • state bool True, if vertical scroll is enabled @@ -519,7 +618,7 @@
- bind_grid(Druid) + bind_grid(self, grid)
Bind the grid component (Static or Dynamic) to recalculate @@ -528,9 +627,13 @@

Parameters:

    -
  • Druid - druid.static_grid or druid.dynamic_grid - grid component +
  • self + Scroll + +
  • +
  • grid + StaticGrid or DynamicGrid + Druid grid component
@@ -546,13 +649,19 @@
- - Scroll:_cancel_animate() + + _cancel_animate(self)
Cancel animation on other animation or input touch +

Parameters:

+
    +
  • self + +
  • +
@@ -564,99 +673,8 @@
- - Events -
-
- Component events - - -

Fields:

-
    -
  • on_scroll - druid_event - On scroll move callback -
  • -
  • on_scroll_to - druid_event - On scroll_to function callback -
  • -
  • on_point_scroll - druid_event - On scrolltoindex function callback -
  • -
- - - - - -
-
- - Fields -
-
- Component fields - - -

Fields:

-
    -
  • view_node - node - Scroll view node -
  • -
  • content_node - node - Scroll content node -
  • -
  • is_inert - bool - Flag, if scroll now moving by inertion -
  • -
  • inertion - vector3 - Current inert speed -
  • -
  • position - vector3 - Current scroll posisition -
  • -
  • target_position - vector3 - Current scroll target position -
  • -
  • available_pos - vector4 - Available position for content node: (minx, maxy, maxx, miny) -
  • -
  • available_size - vector3 - Size of available positions: (width, height, 0) -
  • -
  • drag - druid.drag - Drag component -
  • -
  • Current - selected - index of points of interests - (optional) -
  • -
  • is_animate - bool - Flag, if scroll now animating by gui.animate -
  • -
- - - - - -
-
- - Style + + style
Component style params. @@ -717,6 +735,271 @@ +
+
+

Fields

+ +
+
+ + on_scroll +
+
+ On scroll move callback(self, position) + + +
    +
  • on_scroll + druid_event + +
  • +
+ + + + + +
+
+ + on_scroll_to +
+
+ On scroll_to function callback(self, target, is_instant) + + +
    +
  • on_scroll_to + druid_event + +
  • +
+ + + + + +
+
+ + on_point_scroll +
+
+ On scroll_to_index function callback(self, index, point) + + +
    +
  • on_point_scroll + druid_event + +
  • +
+ + + + + +
+
+ + view_node +
+
+ Scroll view node + + +
    +
  • view_node + node + +
  • +
+ + + + + +
+
+ + content_node +
+
+ Scroll content node + + +
    +
  • content_node + node + +
  • +
+ + + + + +
+
+ + is_inert +
+
+ Flag, if scroll now moving by inertion + + +
    +
  • is_inert + bool + +
  • +
+ + + + + +
+
+ + inertion +
+
+ Current inert speed + + +
    +
  • inertion + vector3 + +
  • +
+ + + + + +
+
+ + position +
+
+ Current scroll posisition + + +
    +
  • position + vector3 + +
  • +
+ + + + + +
+
+ + target_position +
+
+ Current scroll target position + + +
    +
  • target_position + vector3 + +
  • +
+ + + + + +
+
+ + available_pos +
+
+ Available position for content node: (min_x, max_y, max_x, min_y) + + +
    +
  • available_pos + vector4 + +
  • +
+ + + + + +
+
+ + available_size +
+
+ Size of available positions: (width, height, 0) + + +
    +
  • available_size + vector3 + +
  • +
+ + + + + +
+
+ + drag +
+
+ Drag Druid component + + +
    +
  • drag + Drag + +
  • +
+ + + + + +
+
+ + selected +
+
+ Current index of points of interests + + +
    +
  • selected + number + + (optional) +
  • +
+ + + + +
@@ -725,7 +1008,7 @@
generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 +Last updated 2020-10-12 00:29:49
diff --git a/docs/modules/druid.slider.html b/docs/modules/Slider.html similarity index 50% rename from docs/modules/druid.slider.html rename to docs/modules/Slider.html index 4c95cc7..816d36f 100644 --- a/docs/modules/druid.slider.html +++ b/docs/modules/Slider.html @@ -33,83 +33,94 @@

Contents

Modules

-

Topics

-
-

Module druid.slider

+

Module Slider

Druid slider component

-

- -

+

Functions

- + - + - +
init(node, end_pos[, callback])init(self, node, end_pos[, callback]) Component init function
set(value[, is_silent])set(self, value[, is_silent]) Set value for slider
set_steps(steps)set_steps(self, steps) Set slider steps.
-

Tables

+

Fields

- - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + +
EventsComponent eventson_change_valueOn change value callback(self, value)
FieldsComponent fieldsnodeSlider pin node
start_posStart pin node position
posCurrent pin node position
target_posTarger pin node position
end_posEnd pin node position
distLength between start and end position
is_dragCurrent drag state
@@ -122,7 +133,7 @@
- init(node, end_pos[, callback]) + init(self, node, end_pos[, callback])
Component init function @@ -130,8 +141,12 @@

Parameters:

    +
  • self + Slider + +
  • node - node + node Gui pin node
  • end_pos @@ -152,7 +167,7 @@
- set(value[, is_silent]) + set(self, value[, is_silent])
Set value for slider @@ -160,6 +175,10 @@

Parameters:

    +
  • self + Slider + +
  • value number Value from 0 to 1 @@ -178,7 +197,7 @@
- set_steps(steps) + set_steps(self, steps)
Set slider steps. Pin node will @@ -187,6 +206,10 @@

Parameters:

    +
  • self + Slider + +
  • steps number[] Array of steps @@ -203,22 +226,21 @@
-

Tables

+

Fields

- - Events + + on_change_value
- Component events + On change value callback(self, value) -

Fields:

  • on_change_value druid_event - On change value callback +
@@ -228,46 +250,137 @@
- - Fields + + node
- Component fields + Slider pin node -

Fields:

  • node - node - Slider pin node + node +
  • +
+ + + + + +
+
+ + start_pos +
+
+ Start pin node position + + +
  • start_pos vector3 - Start pin node position +
  • +
+ + + + + +
+
+ + pos +
+
+ Current pin node position + + +
  • pos vector3 - Current pin node position +
  • +
+ + + + + +
+
+ + target_pos +
+
+ Targer pin node position + + +
  • target_pos vector3 - Targer pin node position +
  • +
+ + + + + +
+
+ + end_pos +
+
+ End pin node position + + +
  • end_pos vector3 - End pin node position +
  • +
+ + + + + +
+
+ + dist +
+
+ Length between start and end position + + +
  • dist number - Length between start and end position +
  • +
+ + + + + +
+
+ + is_drag +
+
+ Current drag state + + +
  • is_drag bool - Current drag state -
  • -
  • value - number - Current slider value +
@@ -283,7 +396,7 @@
generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 +Last updated 2020-10-12 00:29:49
diff --git a/docs/modules/druid.static_grid.html b/docs/modules/StaticGrid.html similarity index 55% rename from docs/modules/druid.static_grid.html rename to docs/modules/StaticGrid.html index 347b207..8ad2dc5 100644 --- a/docs/modules/druid.static_grid.html +++ b/docs/modules/StaticGrid.html @@ -33,113 +33,139 @@

Contents

Modules

-

Topics

-
-

Module druid.static_grid

+

Module StaticGrid

Component to handle placing components by row and columns.

-

Grid can anchor your elements, get content size and other

+

+ Grid can anchor your elements, get content size and other

Functions

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

Tables

+

Fields

- - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EventsComponent eventson_add_itemOn item add callback(self, node, index)
FieldsComponent fieldson_remove_itemOn item remove callback(self, index)
on_change_itemsOn item add or remove callback(self, index)
on_clearOn grid clear callback(self)
on_update_positionsOn update item positions callback(self)
parentParent gui node
nodesList of all grid nodes
first_indexThe first index of node in grid
last_indexThe last index of node in grid
anchorItem anchor
node_sizeItem size
@@ -152,7 +178,7 @@
- init(parent, element[, in_row=1]) + init(self, parent, element[, in_row=1])
Component init function @@ -160,6 +186,10 @@

Parameters:

    +
  • self + StaticGrid + +
  • parent node The gui node parent, where items will be placed @@ -182,7 +212,7 @@
- get_pos(index) + get_pos(self, index)
Return pos for grid node index @@ -190,6 +220,10 @@

Parameters:

    +
  • self + StaticGrid + +
  • index number The grid element index @@ -209,7 +243,7 @@
- get_index(pos) + get_index(self, pos)
Return index for grid pos @@ -217,6 +251,10 @@

Parameters:

    +
  • self + StaticGrid + +
  • pos vector3 The node position in the grid @@ -236,7 +274,7 @@
- get_index_by_node(node) + get_index_by_node(self, node)
Return grid index by node @@ -244,6 +282,10 @@

Parameters:

    +
  • self + StaticGrid + +
  • node node The gui node in the grid @@ -263,7 +305,7 @@
- set_anchor(anchor) + set_anchor(self, anchor)
Set grid anchor. Default anchor is equal to anchor of grid parent node @@ -271,6 +313,10 @@

Parameters:

    +
  • self + StaticGrid + +
  • anchor vector3 Anchor @@ -284,7 +330,7 @@
- add(item[, index]) + add(self, item[, index])
Add new item to the grid @@ -292,6 +338,10 @@

Parameters:

    +
  • self + StaticGrid + +
  • item node Gui node @@ -310,7 +360,7 @@
- remove(index, is_shift_nodes) + remove(self, index, is_shift_nodes)
Remove the item from the grid. Note that gui node will be not deleted @@ -318,6 +368,10 @@

Parameters:

    +
  • self + StaticGrid + +
  • index number The grid node index to remove @@ -335,12 +389,19 @@
- get_size() + get_size(self)
Return grid content size +

Parameters:

+
    +
  • self + StaticGrid + +
  • +

Returns:

    @@ -355,12 +416,19 @@
- get_all_pos() + get_all_pos(self)
Return array of all node positions +

Parameters:

+
    +
  • self + StaticGrid + +
  • +

Returns:

    @@ -375,7 +443,7 @@
- set_position_function(callback) + set_position_function(self, callback)
Change set position function for grid nodes. It will call on @@ -384,6 +452,10 @@

Parameters:

    +
  • self + StaticGrid + +
  • callback function Function on node set position @@ -403,13 +475,20 @@
- clear() + clear(self)
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 +

Parameters:

+
    +
  • self + StaticGrid + +
  • +

Returns:

    @@ -423,38 +502,21 @@
-

Tables

+

Fields

- - Events + + on_add_item
- Component events + On item add callback(self, node, index) -

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 +
@@ -464,42 +526,197 @@
- - Fields + + on_remove_item
- Component fields + On item remove callback(self, index) + + +
    +
  • on_remove_item + druid_event + +
  • +
+ + + + + +
+
+ + on_change_items +
+
+ On item add or remove callback(self, index) + + +
    +
  • on_change_items + druid_event + +
  • +
+ + + + + +
+
+ + on_clear +
+
+ On grid clear callback(self) + + +
    +
  • on_clear + druid_event + +
  • +
+ + + + + +
+
+ + on_update_positions +
+
+ On update item positions callback(self) + + +
    +
  • on_update_positions + druid_event + +
  • +
+ + + + + +
+
+ + parent +
+
+ Parent gui node -

Fields:

  • parent node - Parent gui node +
  • +
+ + + + + +
+
+ + nodes +
+
+ List of all grid nodes + + +
  • nodes node[] - List of all grid nodes +
  • +
+ + + + + +
+
+ + first_index +
+
+ The first index of node in grid + + +
  • first_index number - The first index of node in grid +
  • +
+ + + + + +
+
+ + last_index +
+
+ The last index of node in grid + + +
  • last_index number - The last index of node in grid +
  • +
+ + + + + +
+
+ + anchor +
+
+ Item anchor + + +
  • anchor vector3 - Item anchor +
  • +
+ + + + + +
+
+ + node_size +
+
+ Item size + + +
  • node_size vector3 - Item size -
  • -
  • border - vector4 - The size of item content +
@@ -515,7 +732,7 @@
generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 +Last updated 2020-10-12 00:29:49
diff --git a/docs/modules/druid.swipe.html b/docs/modules/Swipe.html similarity index 52% rename from docs/modules/druid.swipe.html rename to docs/modules/Swipe.html index eb364c5..20856a8 100644 --- a/docs/modules/druid.swipe.html +++ b/docs/modules/Swipe.html @@ -34,83 +34,77 @@

Modules

-

Topics

-
-

Module druid.swipe

+

Module Swipe

Component to handle swipe gestures on node.

-

Swipe will be triggered, if swipe was started and +

+ Swipe will be triggered, if swipe was started and ended on one node

Functions

- + - +
init(node, on_swipe_callback)init(self, node, on_swipe_callback) Component init function
set_click_zone(zone)set_click_zone(self, zone) Strict swipe click area.

Tables

- - - - - - - - - +
FieldsComponents fields
EventsComponent events
Stylestyle Component style params.
+

Fields

+ + + + + + + + + +
nodeSwipe node
click_zoneRestriction zone


@@ -121,7 +115,7 @@
- init(node, on_swipe_callback) + init(self, node, on_swipe_callback)
Component init function @@ -129,13 +123,17 @@

Parameters:

    +
  • self + Swipe + +
  • node - node + node Gui node
  • on_swipe_callback function - Swipe callback for onswipeend event + Swipe callback for on_swipe_end event
@@ -146,7 +144,7 @@
- set_click_zone(zone) + set_click_zone(self, zone)
Strict swipe click area. Useful for @@ -155,8 +153,12 @@

Parameters:

    +
  • self + Swipe + +
  • zone - node + node Gui node
@@ -171,55 +173,8 @@
- - Fields -
-
- Components fields - - -

Fields:

-
    -
  • node - node - Swipe node -
  • -
  • click_zone - node - Restriction zone - (optional) -
  • -
- - - - - -
-
- - Events -
-
- Component events - - -

Fields:

-
    -
  • on_swipe - druid_event - Trigger on swipe event -
  • -
- - - - - -
-
- - Style + + style
Component style params. @@ -250,6 +205,51 @@ +
+
+

Fields

+ +
+
+ + node +
+
+ Swipe node + + +
    +
  • node + node + +
  • +
+ + + + + +
+
+ + click_zone +
+
+ Restriction zone + + +
    +
  • click_zone + node + + (optional) +
  • +
+ + + + +
@@ -258,7 +258,7 @@
generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 +Last updated 2020-10-12 00:29:49
diff --git a/docs/modules/druid.text.html b/docs/modules/Text.html similarity index 50% rename from docs/modules/druid.text.html rename to docs/modules/Text.html index b3b2feb..08d87b7 100644 --- a/docs/modules/druid.text.html +++ b/docs/modules/Text.html @@ -33,102 +33,124 @@

Contents

Modules

-

Topics

-
-

Module druid.text

+

Module Text

Component to handle all GUI texts.

-

Druid text can adjust itself for text node size +

+ Druid text can adjust itself for text node size Text will never will be outside of his text size (even multiline)

Functions

- + - + - + - + - + - + - + - +
init(node[, value[, no_adjust]])init(self, node[, value[, no_adjust]]) Component init function
get_text_width([text])get_text_width(self[, text]) Calculate text width with font with respect to trailing space
set_to(set_to)set_to(self, set_to) Set text to text field
set_color(color)set_color(self, color) Set color
set_alpha(alpha)set_alpha(self, alpha) Set alpha
set_scale(scale)set_scale(self, scale) Set scale
set_pivot(pivot)set_pivot(self, pivot) Set text pivot.
is_multiline()is_multiline(self) Return true, if text with line break
-

Tables

+

Fields

- - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EventsComponent eventson_set_textOn set text callback(self, text)
FieldsComponent fieldson_update_text_scaleOn adjust text size callback(self, new_scale)
on_set_pivotOn change pivot callback(self, pivot)
nodeText node
posCurrent text position
start_scaleInitial text node scale
scaleCurrent text node scale
start_sizeInitial text node size
text_areaCurrent text node available are
is_no_adjustCurrent text size adjust settings
@@ -141,7 +163,7 @@
- init(node[, value[, no_adjust]]) + init(self, node[, value[, no_adjust]])
Component init function @@ -149,8 +171,12 @@

Parameters:

    +
  • self + Text + +
  • node - node + node Gui text node
  • value @@ -172,7 +198,7 @@
- get_text_width([text]) + get_text_width(self[, text])
Calculate text width with font with respect to trailing space @@ -180,11 +206,13 @@

Parameters:

    +
  • self + Text + +
  • text string - - (optional)
@@ -196,7 +224,7 @@
- set_to(set_to) + set_to(self, set_to)
Set text to text field @@ -204,6 +232,10 @@

Parameters:

    +
  • self + Text + +
  • set_to string Text for node @@ -217,7 +249,7 @@
- set_color(color) + set_color(self, color)
Set color @@ -225,6 +257,10 @@

Parameters:

    +
  • self + Text + +
  • color vector4 Color for node @@ -238,7 +274,7 @@
- set_alpha(alpha) + set_alpha(self, alpha)
Set alpha @@ -246,6 +282,10 @@

Parameters:

    +
  • self + Text + +
  • alpha number Alpha for node @@ -259,7 +299,7 @@
- set_scale(scale) + set_scale(self, scale)
Set scale @@ -267,6 +307,10 @@

Parameters:

    +
  • self + Text + +
  • scale vector3 Scale for node @@ -280,7 +324,7 @@
- set_pivot(pivot) + set_pivot(self, pivot)
Set text pivot. Text will re-anchor inside @@ -289,6 +333,10 @@

Parameters:

    +
  • self + Text + +
  • pivot gui.pivot Gui pivot constant @@ -302,12 +350,19 @@
- is_multiline() + is_multiline(self)
Return true, if text with line break +

Parameters:

+
    +
  • self + Text + +
  • +

Returns:

    @@ -321,30 +376,21 @@
-

Tables

+

Fields

- - Events + + on_set_text
- Component events + On set text callback(self, text) -

Fields:

  • on_set_text druid_event - On set text callback -
  • -
  • on_update_text_scale - druid_event - On adjust text size callback -
  • -
  • on_set_pivot - druid_event - On change pivot callback +
@@ -354,46 +400,177 @@
- - Fields + + on_update_text_scale
- Component fields + On adjust text size callback(self, new_scale) + + +
    +
  • on_update_text_scale + druid_event + +
  • +
+ + + + + +
+
+ + on_set_pivot +
+
+ On change pivot callback(self, pivot) + + +
    +
  • on_set_pivot + druid_event + +
  • +
+ + + + + +
+
+ + node +
+
+ Text node -

Fields:

  • node - node - Text node + node +
  • +
+ + + + + +
+
+ + pos +
+
+ Current text position + + +
  • pos vector3 - Current text position +
  • +
+ + + + + +
+
+ + start_scale +
+
+ Initial text node scale + + +
  • start_scale vector3 - Initial text node scale +
  • +
+ + + + + +
+
+ + scale +
+
+ Current text node scale + + +
  • scale vector3 - Current text node scale +
  • +
+ + + + + +
+
+ + start_size +
+
+ Initial text node size + + +
  • start_size vector3 - Initial text node size +
  • +
+ + + + + +
+
+ + text_area +
+
+ Current text node available are + + +
  • text_area vector3 - Current text node available are +
  • +
+ + + + + +
+
+ + is_no_adjust +
+
+ Current text size adjust settings + + +
  • is_no_adjust bool - Current text size adjust settings -
  • -
  • color - vector3 - Current text color +
@@ -409,7 +586,7 @@
generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 +Last updated 2020-10-12 00:29:49
diff --git a/docs/modules/druid.timer.html b/docs/modules/Timer.html similarity index 51% rename from docs/modules/druid.timer.html rename to docs/modules/Timer.html index 8468527..ae6fd75 100644 --- a/docs/modules/druid.timer.html +++ b/docs/modules/Timer.html @@ -33,86 +33,92 @@

Contents

Modules

-

Topics

-
-

Module druid.timer

+

Module Timer

Component to handle GUI timers.

-

Timer updating by game delta time. If game is not focused - +

+ Timer updating by game delta time. If game is not focused - timer will be not updated.

Functions

- + - + - + - +
init(node, seconds_from[, seconds_to=0[, callback]])init(self, node, seconds_from[, seconds_to=0[, callback]]) Component init function
set_to(set_to)set_to(self, set_to) Set text to text field
set_state(is_on)set_state(self, is_on) Called when update
set_interval(from, to)set_interval(self, from, to) Set time interval
-

Tables

+

Fields

- - + + - - + + + + + + + + + + + + + + + + + +
EventsComponent eventson_tickOn timer tick.
FieldsComponent fieldson_set_enabledOn timer change enabled state callback(self, is_enabled)
on_timer_endOn timer end callback
nodeTrigger node
fromInitial timer value
targetTarget timer value
@@ -125,7 +131,7 @@
- init(node, seconds_from[, seconds_to=0[, callback]]) + init(self, node, seconds_from[, seconds_to=0[, callback]])
Component init function @@ -133,8 +139,12 @@

Parameters:

    +
  • self + Timer + +
  • node - node + node Gui text node
  • seconds_from @@ -160,7 +170,7 @@
- set_to(set_to) + set_to(self, set_to)
Set text to text field @@ -168,6 +178,10 @@

Parameters:

    +
  • self + Timer + +
  • set_to number Value in seconds @@ -181,7 +195,7 @@
- set_state(is_on) + set_state(self, is_on)
Called when update @@ -189,6 +203,10 @@

Parameters:

    +
  • self + Timer + +
  • is_on bool Timer enable state @@ -202,7 +220,7 @@
- set_interval(from, to) + set_interval(self, from, to)
Set time interval @@ -210,6 +228,10 @@

Parameters:

    +
  • self + Timer + +
  • from number Start time in seconds @@ -226,30 +248,21 @@
-

Tables

+

Fields

- - Events + + on_tick
- Component events + On timer tick. Fire every second callback(self, value) -

Fields:

  • on_tick druid_event - On timer tick callback. Fire every second -
  • -
  • on_set_enabled - druid_event - On timer change enabled state callback -
  • -
  • on_timer_end - druid_event - On timer end callback +
@@ -259,30 +272,97 @@
- - Fields + + on_set_enabled
- Component fields + On timer change enabled state callback(self, is_enabled) + + +
    +
  • on_set_enabled + druid_event + +
  • +
+ + + + + +
+
+ + on_timer_end +
+
+ On timer end callback + + +
    +
  • on_timer_end + druid_event + (self, Timer) +
  • +
+ + + + + +
+
+ + node +
+
+ Trigger node -

Fields:

  • node - node - Trigger node + node +
  • +
+ + + + + +
+
+ + from +
+
+ Initial timer value + + +
  • from number - Initial timer value +
  • +
+ + + + + +
+
+ + target +
+
+ Target timer value + + +
  • target number - Target timer value -
  • -
  • value - number - Current timer value +
@@ -298,7 +378,7 @@
generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 +Last updated 2020-10-12 00:29:49
diff --git a/docs/modules/component.html b/docs/modules/component.html deleted file mode 100644 index 597d4c2..0000000 --- a/docs/modules/component.html +++ /dev/null @@ -1,601 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module component

-

Basic class for all Druid components.

-

To create you component, use component.create

- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
set_style(style)Set current component style table.
set_template(template)Set current component template name
set_nodes(nodes)Set current component nodes
get_context()Get current component context
increase_input_priority()Increase input priority in current input stack
reset_input_priority()Reset input priority in current input stack
get_node(node_or_name)Get node for component by name.
get_druid()Return druid with context of calling 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.
- -
-
- - -

Functions

- -
-
- - set_style(style) -
-
- Set current component style table. - Invoke on_style_change on component, if exist. Component should handle - their style changing and store all style params - - -

Parameters:

-
    -
  • style - table - Druid style module -
  • -
- - - - - -
-
- - set_template(template) -
-
- Set current component template name - - -

Parameters:

-
    -
  • template - string - Component template name -
  • -
- - - - - -
-
- - set_nodes(nodes) -
-
- Set current component nodes - - -

Parameters:

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

Returns:

-
    - - table - Component context -
- - - - -
-
- - increase_input_priority() -
-
- Increase input priority in current input stack - - - - - - - -
-
- - reset_input_priority() -
-
- Reset input priority in current input stack - - - - - - - -
-
- - 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 -
- - - - -
-
- - get_name() -
-
- Return component name - - - -

Returns:

-
    - - string - The component name -
- - - - -
-
- - set_input_enabled(state) -
-
- Set component input state. By default it enabled - You can disable any input of component by this function - - -

Parameters:

-
    -
  • state - bool - The component input state -
  • -
- -

Returns:

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

Returns:

-
    - - Component or nil - The druid component instance or nil -
- - - - -
-
- - setup_component(table, table, table) -
-
- Setup component context and his style table - - -

Parameters:

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

Returns:

-
    - - component - Component itself -
- - - - -
-
- - __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_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:

-
    -
  • children - component - The druid component instance -
  • -
- - - - - -
-
- - __remove_children(children) -
-
- Remove child from component children list - - -

Parameters:

-
    -
  • children - component - The druid component instance -
  • -
- - - - - -
-
- - 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 - (default {}) -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 -
-
- - diff --git a/docs/modules/druid.back_handler.html b/docs/modules/druid.back_handler.html deleted file mode 100644 index 5971afb..0000000 --- a/docs/modules/druid.back_handler.html +++ /dev/null @@ -1,227 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module druid.back_handler

-

Component to handle back key (android, backspace)

-

- -

- - -

Functions

- - - - - - - - - -
init(callback[, Callback])Component init function
on_input(action_id, action)Input handler for component
-

Tables

- - - - - - - - - -
EventsComponent events
FieldsComponent fields
- -
-
- - -

Functions

- -
-
- - init(callback[, Callback]) -
-
- Component init function - - -

Parameters:

-
    -
  • callback - callback - On back button -
  • -
  • Callback - params - argument - (optional) -
  • -
- - - - - -
-
- - on_input(action_id, action) -
-
- Input handler for component - - -

Parameters:

-
    -
  • action_id - string - on_input action id -
  • -
  • action - table - on_input action -
  • -
- - - - - -
-
-

Tables

- -
-
- - Events -
-
- Component events - - -

Fields:

-
    -
  • on_back - druid_event - On back handler callback -
  • -
- - - - - -
-
- - Fields -
-
- Component fields - - -

Fields:

-
    -
  • params - any - Params to click callbacks -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 -
-
- - diff --git a/docs/modules/druid.blocker.html b/docs/modules/druid.blocker.html deleted file mode 100644 index 2d25873..0000000 --- a/docs/modules/druid.blocker.html +++ /dev/null @@ -1,246 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module druid.blocker

-

Component to block input on specify zone by node

-

- -

- - -

Functions

- - - - - - - - - - - - - -
init(node)Component init function
set_enabled(state)Set enabled blocker component state
is_enabled()Return blocked enabled state
-

Tables

- - - - - - - - - -
EventsComponent events
FieldsComponent fields
- -
-
- - -

Functions

- -
-
- - init(node) -
-
- Component init function - - -

Parameters:

-
    -
  • node - node - Gui node -
  • -
- - - - - -
-
- - set_enabled(state) -
-
- Set enabled blocker component state - - -

Parameters:

-
    -
  • state - bool - Enabled state -
  • -
- - - - - -
-
- - is_enabled() -
-
- Return blocked enabled state - - - -

Returns:

-
    - - bool - True, if blocker is enabled -
- - - - -
-
-

Tables

- -
-
- - Events -
-
- Component events - - -

Fields:

-
    -
  • on_click - druid_event - On release button callback -
  • -
  • on_enable_change - druid_event - On enable/disable callback -
  • -
- - - - - -
-
- - Fields -
-
- Component fields - - -

Fields:

-
    -
  • node - node - Trigger node -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 -
-
- - diff --git a/docs/modules/druid.checkbox_group.html b/docs/modules/druid.checkbox_group.html deleted file mode 100644 index f2aba40..0000000 --- a/docs/modules/druid.checkbox_group.html +++ /dev/null @@ -1,251 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module druid.checkbox_group

-

Checkbox group module

-

- -

- - -

Functions

- - - - - - - - - - - - - -
init(node, callback[, click=node])Component init function
set_state(indexes)Set checkbox group state
get_state()Return checkbox group state
-

Tables

- - - - - - - - - -
EventsComponent events
FieldsComponent fields
- -
-
- - -

Functions

- -
-
- - init(node, callback[, click=node]) -
-
- Component init function - - -

Parameters:

-
    -
  • node - node[] - Array of gui node -
  • -
  • callback - function - Checkbox callback -
  • -
  • click - node[] - node Array of trigger nodes, by default equals to nodes - (default node) -
  • -
- - - - - -
-
- - set_state(indexes) -
-
- Set checkbox group state - - -

Parameters:

-
    -
  • indexes - bool[] - Array of checkbox state -
  • -
- - - - - -
-
- - get_state() -
-
- Return checkbox group state - - - -

Returns:

-
    - - bool[] - Array if checkboxes state -
- - - - -
-
-

Tables

- -
-
- - Events -
-
- Component events - - -

Fields:

-
    -
  • on_checkbox_click - druid_event - On any checkbox click -
  • -
- - - - - -
-
- - Fields -
-
- Component fields - - -

Fields:

-
    -
  • checkboxes - table - Array of checkbox components -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 -
-
- - diff --git a/docs/modules/druid.drag.html b/docs/modules/druid.drag.html deleted file mode 100644 index d71152b..0000000 --- a/docs/modules/druid.drag.html +++ /dev/null @@ -1,291 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module druid.drag

-

Component to handle drag action on node.

-

Drag have correct handling for multitouch and swap - touched while dragging. Drag will be processed even - the cursor is outside of node, if drag is already started

- - -

Functions

- - - - - - - - - -
init(node, on_drag_callback)Drag component constructor
set_click_zone(zone)Strict drag click area.
-

Tables

- - - - - - - - - - - - - -
EventsComponent events
FieldsComponents fields
StyleComponent style params.
- -
-
- - -

Functions

- -
-
- - init(node, on_drag_callback) -
-
- Drag component constructor - - -

Parameters:

-
    -
  • node - node - GUI node to detect dragging -
  • -
  • on_drag_callback - function - Callback for ondragevent(self, dx, dy) -
  • -
- - - - - -
-
- - set_click_zone(zone) -
-
- Strict drag click area. Useful for - restrict events outside stencil node - - -

Parameters:

-
    -
  • zone - node - Gui node -
  • -
- - - - - -
-
-

Tables

- -
-
- - Events -
-
- Component events - - -

Fields:

-
    -
  • on_touch_start - druid_event - (self) Event on touch start -
  • -
  • on_touch_end - druid_event - (self) Event on touch end -
  • -
  • on_drag_start - druid_event - (self) Event on drag start -
  • -
  • on_drag - druid_event - (self, dx, dy) Event on drag progress -
  • -
  • on_drag_end - druid_event - (self) Event on drag end -
  • -
- - - - - -
-
- - Fields -
-
- Components fields - - -

Fields:

-
    -
  • is_touch - bool - Is component now touching -
  • -
  • is_drag - bool - Is component now dragging -
  • -
  • can_x - bool - Is drag component process vertical dragging. Default - true -
  • -
  • can_y - bool - Is drag component process horizontal. Default - true -
  • -
  • x - number - Current touch x position -
  • -
  • y - number - Current touch y position -
  • -
  • touch_start_pos - vector3 - Touch start position -
  • -
- - - - - -
-
- - Style -
-
- Component style params. - You can override this component styles params in druid styles table - or create your own style - - -

Fields:

-
    -
  • DRAG_DEADZONE - number - Distance in pixels to start dragging - (default 10) -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 -
-
- - diff --git a/docs/modules/druid.grid.html b/docs/modules/druid.grid.html deleted file mode 100644 index 9982cc3..0000000 --- a/docs/modules/druid.grid.html +++ /dev/null @@ -1,381 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module druid.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
set_offset(offset)Set grid items offset, the distance between items
set_anchor(acnhor)Set grid anchor
add(item[, index])Add new item to the grid
get_size()Return grid content size
get_all_pos()Return array of all node positions
clear()Clear grid nodes array.
-

Tables

- - - - - - - - - -
EventsComponent events
FieldsComponent fields
- -
-
- - -

Functions

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

Parameters:

-
    -
  • parent - node - The gui node parent, where items will be placed -
  • -
  • element - node - Element prefab. Need to get it size -
  • -
  • in_row - number - How many nodes in row can be placed - (default 1) -
  • -
- - - - - -
-
- - set_offset(offset) -
-
- Set grid items offset, the distance between items - - -

Parameters:

-
    -
  • offset - vector3 - Offset -
  • -
- - - - - -
-
- - set_anchor(acnhor) -
-
- Set grid anchor - - -

Parameters:

-
    -
  • acnhor - vector3 - Anchor -
  • -
- - - - - -
-
- - add(item[, index]) -
-
- Add new item to the grid - - -

Parameters:

-
    -
  • item - node - Gui node -
  • -
  • index - number - The item position. By default add as last item - (optional) -
  • -
- - - - - -
-
- - 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 -
- - - - -
-
- - clear() -
-
- Clear grid nodes array. GUI nodes will be not deleted! - If you want to delete GUI nodes, use grid.nodes array before grid:clear - - - - - - - -
-
-

Tables

- -
-
- - Events -
-
- Component events - - -

Fields:

-
    -
  • on_add_item - druid_event - On item add callback -
  • -
  • on_remove_item - druid_event - On item 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 -
  • -
  • offset - vector3 - Item distance between each other items -
  • -
  • anchor - vector3 - Item anchor -
  • -
  • node_size - vector3 - Item size -
  • -
  • border - vector4 - The size of item content -
  • -
  • border_offer - vector3 - The border offset for correct anchor calculations -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2020-06-14 20:13:02 -
-
- - diff --git a/docs/modules/druid.helper.html b/docs/modules/druid.helper.html index 6986acf..5590dc8 100644 --- a/docs/modules/druid.helper.html +++ b/docs/modules/druid.helper.html @@ -38,40 +38,29 @@

Modules

-

Topics

- @@ -80,9 +69,7 @@

Module druid.helper

Text node or icon node can be nil

-

- -

+

Functions

@@ -325,7 +312,7 @@
generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 +Last updated 2020-10-12 00:29:49
diff --git a/docs/modules/druid.html b/docs/modules/druid.html index 85bca7f..ec93bd4 100644 --- a/docs/modules/druid.html +++ b/docs/modules/druid.html @@ -38,40 +38,29 @@

Modules

-

Topics

- @@ -81,23 +70,16 @@

Module druid

Druid UI Library.

- -

Powerful Defold component based UI library. Use standart + Powerful Defold component based UI library. Use standart components or make your own game-specific components to - make amazing GUI in your games.

- + make amazing GUI in your games.

Contains the several basic components and examples to how to do your custom complex components to - separate UI game logic to small files

- - -
-require("druid.druid")
-function init(self)
-    self.druid = druid.new(self)
-end
-
- + separate UI game logic to small files +

require("druid.druid") + function init(self) + self.druid = druid.new(self) + end

@@ -153,7 +135,7 @@
Register external druid component. After register you can create the component with - druidinstance:new{name}. For example druid:new_button(...) + druid_instance:new_{name}. For example `druid:new_button(...)`

Parameters:

@@ -233,7 +215,7 @@
Set text function Druid locale component will call this function - to get translated text. After settextfuntion + to get translated text. After set_text_funtion all existing locale component will be updated @@ -279,7 +261,7 @@
Callback on global window event. - Used to trigger onfocuslost and onfocusgain + Used to trigger on_focus_lost and on_focus_gain

Parameters:

@@ -331,7 +313,7 @@
generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 +Last updated 2020-10-12 00:29:49
diff --git a/docs/modules/druid.radio_group.html b/docs/modules/druid.radio_group.html deleted file mode 100644 index fe429d0..0000000 --- a/docs/modules/druid.radio_group.html +++ /dev/null @@ -1,251 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module druid.radio_group

-

Radio group module

-

- -

- - -

Functions

- - - - - - - - - - - - - -
init(node, callback[, click=node])Component init function
set_state(index)Set radio group state
get_state()Return radio group state
-

Tables

- - - - - - - - - -
EventsComponent events
FieldsComponent fields
- -
-
- - -

Functions

- -
-
- - init(node, callback[, click=node]) -
-
- Component init function - - -

Parameters:

-
    -
  • node - node[] - Array of gui node -
  • -
  • callback - function - Radio callback -
  • -
  • click - node[] - node Array of trigger nodes, by default equals to nodes - (default node) -
  • -
- - - - - -
-
- - set_state(index) -
-
- Set radio group state - - -

Parameters:

-
    -
  • index - number - Index in radio group -
  • -
- - - - - -
-
- - get_state() -
-
- Return radio group state - - - -

Returns:

-
    - - number - Index in radio group -
- - - - -
-
-

Tables

- -
-
- - Events -
-
- Component events - - -

Fields:

-
    -
  • on_radio_click - druid_event - On any checkbox click -
  • -
- - - - - -
-
- - Fields -
-
- Component fields - - -

Fields:

-
    -
  • checkboxes - table - Array of checkbox components -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 -
-
- - diff --git a/docs/modules/druid_instance.html b/docs/modules/druid_instance.html deleted file mode 100644 index c0865a3..0000000 --- a/docs/modules/druid_instance.html +++ /dev/null @@ -1,997 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module druid_instance

-

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:

- - - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
druid:initialize(table, table)Druid class constructor
druid:create(component, ...)Create new druid component
druid:final()Call on final function on gui_script.
druid:remove(component)Remove component from druid instance.
druid:update(dt)Druid update function
druid:on_input(action_id, action)Druid on_input function
druid:on_message(message_id, message, sender)Druid on_message function
druid:on_focus_lost()Druid on focus lost interest function.
druid:on_focus_gained()Druid on focus gained interest function.
druid:on_layout_change()Druid on layout change function.
druid.on_language_change()Druid on language change.
druid:new_button(...)Create button basic component
druid:new_blocker(...)Create blocker basic component
druid:new_back_handler(...)Create back_handler basic component
druid:new_hover(...)Create hover basic component
druid:new_text(...)Create text basic component
druid:new_grid(...)Create grid basic component - Deprecated
druid:new_static_grid(...)Create static grid basic component
druid:new_scroll(...)Create scroll basic component
druid:new_swipe(...)Create swipe basic component
druid:new_drag(...)Create drag basic component
druid:new_dynamic_grid(...)Create dynamic grid component
druid:new_lang_text(...)Create lang_text component
druid:new_slider(...)Create slider component
druid:new_checkbox(...)Create checkbox component
druid:new_input(...)Create input component
druid:new_checkbox_group(...)Create checkbox_group component
druid:new_radio_group(...)Create radio_group component
druid:new_timer(...)Create timer component
druid:new_progress(...)Create progress component
- -
-
- - -

Functions

- -
-
- - druid:initialize(table, table) -
-
- Druid class constructor - - -

Parameters:

-
    -
  • table - style - Druid style module -
  • -
  • table - style - Druid style module -
  • -
- - - - - -
-
- - druid:create(component, ...) -
-
- Create new druid component - - -

Parameters:

-
    -
  • component - Component - Component module -
  • -
  • ... - args - Other component params to pass it to component:init function -
  • -
- - - - - -
-
- - druid:final() -
-
- Call on final function on guiscript. It will call onremove - on all druid components - - - - - - - -
-
- - druid:remove(component) -
-
- Remove component from druid instance. - Component on_remove function will be invoked, if exist. - - -

Parameters:

-
    -
  • component - Component - Component instance -
  • -
- - - - - -
-
- - druid:update(dt) -
-
- Druid update function - - -

Parameters:

-
    -
  • dt - number - Delta time -
  • -
- - - - - -
-
- - druid:on_input(action_id, action) -
-
- Druid on_input function - - -

Parameters:

-
    -
  • action_id - hash - Actionid from oninput -
  • -
  • action - table - Action from on_input -
  • -
- - - - - -
-
- - druid:on_message(message_id, message, sender) -
-
- Druid on_message function - - -

Parameters:

-
    -
  • message_id - hash - Messageid from onmessage -
  • -
  • message - table - Message from on_message -
  • -
  • sender - hash - Sender from on_message -
  • -
- - - - - -
-
- - druid:on_focus_lost() -
-
- Druid on focus lost interest function. - This one called by onwindowcallback by global window listener - - - - - - - -
-
- - druid:on_focus_gained() -
-
- Druid on focus gained interest function. - This one called by onwindowcallback by global window listener - - - - - - - -
-
- - druid:on_layout_change() -
-
- Druid on layout change function. - Called on update gui layout - - - - - - - -
-
- - druid.on_language_change() -
-
- Druid on language change. - This one called by global gruid.onlanguagechange, but can be - call manualy to update all translations - - - - - - - -
-
- - druid:new_button(...) -
-
- Create button basic component - - -

Parameters:

-
    -
  • ... - args - button init args -
  • -
- -

Returns:

-
    - - Component - button component -
- - - - -
-
- - druid:new_blocker(...) -
-
- Create blocker basic component - - -

Parameters:

-
    -
  • ... - args - blocker init args -
  • -
- -

Returns:

-
    - - Component - blocker component -
- - - - -
-
- - druid:new_back_handler(...) -
-
- Create back_handler basic component - - -

Parameters:

-
    -
  • ... - args - back_handler init args -
  • -
- -

Returns:

-
    - - Component - back_handler component -
- - - - -
-
- - druid:new_hover(...) -
-
- Create hover basic component - - -

Parameters:

-
    -
  • ... - args - hover init args -
  • -
- -

Returns:

-
    - - Component - hover component -
- - - - -
-
- - druid:new_text(...) -
-
- Create text basic component - - -

Parameters:

-
    -
  • ... - args - text init args -
  • -
- -

Returns:

-
    - - Component - text component -
- - - - -
-
- - druid:new_grid(...) -
-
- Create grid basic component - Deprecated - - -

Parameters:

-
    -
  • ... - args - grid init args -
  • -
- -

Returns:

-
    - - Component - grid component -
- - - - -
-
- - druid:new_static_grid(...) -
-
- Create static grid basic component - - -

Parameters:

-
    -
  • ... - args - grid init args -
  • -
- -

Returns:

-
    - - Component - grid component -
- - - - -
-
- - druid:new_scroll(...) -
-
- Create scroll basic component - - -

Parameters:

-
    -
  • ... - args - scroll init args -
  • -
- -

Returns:

-
    - - Component - scroll component -
- - - - -
-
- - druid:new_swipe(...) -
-
- Create swipe basic component - - -

Parameters:

-
    -
  • ... - args - swipe init args -
  • -
- -

Returns:

-
    - - Component - swipe component -
- - - - -
-
- - druid:new_drag(...) -
-
- Create drag basic component - - -

Parameters:

-
    -
  • ... - args - drag init args -
  • -
- -

Returns:

-
    - - Componetn - drag component -
- - - - -
-
- - druid:new_dynamic_grid(...) -
-
- Create dynamic grid component - - -

Parameters:

-
    -
  • ... - args - grid init args -
  • -
- -

Returns:

-
    - - Component - grid component -
- - - - -
-
- - druid:new_lang_text(...) -
-
- Create lang_text component - - -

Parameters:

-
    -
  • ... - args - lang_text init args -
  • -
- -

Returns:

-
    - - Component - lang_text component -
- - - - -
-
- - druid:new_slider(...) -
-
- Create slider component - - -

Parameters:

-
    -
  • ... - args - slider init args -
  • -
- -

Returns:

-
    - - Component - slider component -
- - - - -
-
- - druid:new_checkbox(...) -
-
- Create checkbox component - - -

Parameters:

-
    -
  • ... - args - checkbox init args -
  • -
- -

Returns:

-
    - - Component - checkbox component -
- - - - -
-
- - druid:new_input(...) -
-
- Create input component - - -

Parameters:

-
    -
  • ... - args - input init args -
  • -
- -

Returns:

-
    - - Component - input component -
- - - - -
-
- - druid:new_checkbox_group(...) -
-
- Create checkbox_group component - - -

Parameters:

-
    -
  • ... - args - checkbox_group init args -
  • -
- -

Returns:

-
    - - Component - checkbox_group component -
- - - - -
-
- - druid:new_radio_group(...) -
-
- Create radio_group component - - -

Parameters:

-
    -
  • ... - args - radio_group init args -
  • -
- -

Returns:

-
    - - Component - radio_group component -
- - - - -
-
- - druid:new_timer(...) -
-
- Create timer component - - -

Parameters:

-
    -
  • ... - args - timer init args -
  • -
- -

Returns:

-
    - - Component - timer component -
- - - - -
-
- - druid:new_progress(...) -
-
- Create progress component - - -

Parameters:

-
    -
  • ... - args - progress init args -
  • -
- -

Returns:

-
    - - Component - progress component -
- - - - -
-
- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 -
-
- - diff --git a/docs/topics/01-components.md.html b/docs/topics/01-components.md.html deleted file mode 100644 index e470172..0000000 --- a/docs/topics/01-components.md.html +++ /dev/null @@ -1,513 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- - - - -

Druid components

- - -

-

Button

-

Button API here

- -

Overview

-

Basic Druid input component. Handle input on node and provide different callbacks on touch events.

- -

Setup

-

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)

- -
-- **self** - Druid self context
-- **params** - Additional params, specified on button creating
-- **button_instance** - button itself
-
- -

- You can set params on button callback on button creating: druid:new_button("node_name", callback, params). This params will pass in callback as second argument -- Button have next events:

- -
-- **on_click** - basic button callback
-- **on_repeated_click** - repeated click callback, while holding the button, don't trigger if callback is empty
-- **on_long_click** - callback on long button tap, don't trigger if callback is empty
-- **on_hold_click** - hold callback, before long_click trigger, don't trigger if callback is empty
-- **on_double_click** - different callback, if tap button 2+ in row, don't trigger if callback is empty
-
- -

- Click event will not trigger, if between pressed and released state cursor was outside of node zone -- If button have double click event and it is triggered, usual callback will be not invoked -- If you have stencil on buttons and you don't want trigger them outside of stencil node, you can use button:set_click_zone to restrict button click zone -- Button can have key trigger to use then by key: button:set_key_trigger -- Animation node can be used for example to animate small icon on big panel. Node name of trigger zone will be big panel and animation node will be small icon

- - -

-

Text

-

Text API here

- -

Overview

-

Basic Druid text component. Text components by default have the text size adjusting.

- -

Setup

-

Create text node with druid: text = druid:new_text(node_name, [initial_value], [is_disable_size_adjust])

- -

Notes

-

- Text component by default have auto adjust text sizing. Text never will be bigger, than text node size, which you can setup in GUI scene. It can be disabled on component creating by settings argument is_no_adjust to true

- -

- -
    -
  • Text pivot can be changed with text:set_pivot, and text will save their position inside their text size box:
  • -
- -

- - -

-

Blocker

-

Blocker API here

- -

Overview

-

Druid component for block input. Use it to block input in special zone.

- -

Setup

-

Create blocker component with druid: druid:new_blocker(node_name)

- -

Notes

-

Explanation: -

- -

Blue zone is button with close_window callback

- -

Yellow zone is blocker with window content

- -

So you can do the safe zones, when you have the big buttons

- - -

-

Back Handler

-

Back handler API here

- -

Overview

-

Component to handle back button. It handle Android back button and Backspace key. Key triggers in input.binding should be setup for correct working.

- -

Setup

-

Setup callback with druid:new_back_handler(callback)

- -

Notes

- - -

-

Lang text

-

Lang text API here

- -

Overview

-

Wrap on Text component to handle localization. It uses druid gettextfunction to set text by it's id

- -

Setup

-

Create lang text component with druid text = druid:new_lang_text(node_name, locale_id)

- -

Notes

- - -

-

Scroll

-

Scroll API here

- -

Overview

-

Basic Druid scroll component. Handle all scrolling stuff in druid GUI

- -

Setup

-

Create scroll component with druid: scroll = druid:new_scroll(view_node, content_node).

- -

Viewnode_ - is static part. It capturing user input and recognize scrolling touches

- -

Contentnode_ - is dynamic part. This node will change position by scroll system

- -

Initial scroll size will be equal to contentnode_ node size. The initial view box will be equal to viewnode_ node size

- -

Usually, Place viewnode_ and as children add contentnode_: - -

- -

*Here contentnode below viewnode, in game content_node be able to scroll left until end*

- -

Notes

-

- Scroll by default style have inertion and extra size for strecthing effect. It can be adjust via scroll style settings -- You can setup "points of interest". Scroll always will be centered on closes point of interest. It is able to create slider without inertion and points of interest on each scroll element. -- Scroll have next events:

- -
-- *on_scroll* (self, position) On scroll move callback
-- *on_scroll_to* (self, position, is_instant) On scroll_to function callback
-- *on_point_scroll* (self, item_index, position) On scroll_to_index function callback
-
- -

- You can adjust scroll content size by scroll:set_size(node_size). It will setup new size to content node -- You can enabled or disable inertion mode via scroll:set_intert(state) -- You can adjust extra stretch size via scroll:set_extra_stretch_size -- Multitouch is required for scroll. Scroll is correctly handling touch_id swap while dragging scroll

- - -

-

Progress

-

Progress API here

- -

Overview

-

Basic Druid progress bar component

- -

Setup

-

Create progress bar component with druid: progress = druid:new_progress(node_name, key, init_value)

- -

Node name should have maximum node size, so in GUI scene, node_name should be fully filled. -Key is value from druid const: const.SIDE.X (or just "x") or const.SIDE.Y (or just "y")

- -

Notes

-

- Progress correct working with 9slice nodes, it trying to set size by setsize_ first, if it is not possible, it set up sizing via setscale_ -- 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

- -

Overview

-

Basic Druid slider component

- -

Setup

-

Create slider component with druid: slider = druid:new_slider(node_name, end_pos, callback)

- -

Pin node (node_name in params) should be placed in zero position (initial). It will be available to mode Pin node between start pos and end pos.

- -

Notes

-

- 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

- -

Setup

-

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

- -

Notes

-

- Input component handle user text input. Input contains from button and text components. Button needed for selecting/unselecting input field -- Long click on input field for clear and select input field (clearing can be disable via styles) -- Click outside of button to unselect input field -- On focus lost (game minimized) input field will be unselected -- You can setup max length of the text -- You can setup allowed characters. On add not allowed characters on_input_wrong will be called. By default it cause simple shake animation -- The keyboard for input will not show on mobile HTML5. So input field in mobile HTML5 is not working now -- To make work different keyboard type, make sure value in game.project Android:InputMethod set to HidderInputField (https://defold.com/manuals/project-settings/#input-method)

- - -

-

Checkbox

-

Checkbox API here

- -

Overview

-

Basic Druid checkbox component.

- -

Setup

-

Create checkbox component with druid: checkbox = druid:new_checkbox(node, callback)

- -

Notes

-

- 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

- -

Overview

-

Several checkboxes in one group

- -

Setup

-

Create checkbox_group component with druid: group = druid:new_checkbox_group(nodes[], callback)

- -

Notes

-

- Callback arguments: function(self, checkbox_index). Index is equals in nodes[] array in component constructor -- You can get/set checkbox_group state with group:set_state() and group:get_state()

- - -

-

Radio group

-

Radio group API here

- -

Overview

-

Several checkboxes in one group with single choice

- -

Setup

-

Create radio_group component with druid: group = druid:new_radio_group(nodes[], callback)

- -

Notes

-

- Callback arguments: function(self, checkbox_index). Index is equals in nodes[] array in component constructor -- 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

- -

Overview

-

Handle timer work on gui text node

- -

Setup

-

Create timer component with druid: timer = druid:new_timer(text_node, from_seconds, to_seconds, callback)

- -

Notes

-

- Timer fires callback, when timer value equals to toseconds_ -- Timer will setup text node with current timer value -- Timer uses update function to handle time

- - -

-

Static Grid

-

Static Grid API here

- -

Overview

-

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_static_grid(parent_node, prefab_node, max_in_row_elements)

- -

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

-

Hover API here

- -

Overview

-

System Druid component, handle hover node state.

- -

Setup

-

Create hover component with druid: hover = druid:new_hover(node, callback)

- -

Notes

-

- By default, hover handles hover event with pressed touch action_id. So it's mean, what mouse or touch have to be pressed -- On desktop platforms there is onmousehover event. It's event on mouse hover without any action id -- By default, assume what node is on not hovered state (both hover and mousehover_)

- - -

-

Swipe

-

Swipe API here

- -

Overview

-

System Druid component, handle swipe actions on node

- -

Setup

-

Create swipe component with druid: hover = druid:new_swipe(node, swipe_callback)

- -

Notes

-

- Swipe callback have next params: (self, swipe_side, distance, time)

- -
-- **self** - Druid self context
-- **swipe_side**: *string* - values from ["up", "down", "left", "right"]
-- **distance**: *number* - in pixels, distance of swipe
-- **time**: *number* - in seconds, time of swiping
-
- -

- Swipe trigger only, if all input actions was on swipe node. If action will be outside of node, swipe status will be reseted -- In swipe style table you can adjust minimal distance and maximum time to trigg- Hover state trigger only with touch on mobile devices or button mouse holding. Just mouse over swipe -- In swipe style table you can toggle type of swipe triggering. if SWIPETRIGGERON_MOVE setup to true - swipe will trigger as swipe can be triggered. If setup to false - swipe will trigger only on released action -- If you have stencil on swipe node and you don't want trigger it outside of stencil node, you can use swipe:set_click_zone to restrict swipe zonethout buttons is now not allowed.

- - -

-

Drag

-

Drag API here

- -

Overview

-

System Druid component, handle drag actions on node

- -

Setup

-

Create drag component with druid: hover = druid:new_drag(node, drag_callback)

- -

Notes

-

- Drag callback have next params: (self, swipe_side, distance, time)

- -
-- **self**: Druid self context
-- **dx**: *number* - delta x position
-- **dy**: *number* - delta y position
-
- -

- In styles, you can point the drag start deadzone. Default value is 10 pixels -- Drag correctly process multitouch. You can switch touch_id, while dragging on node with correct dx and dy values (made for correct scrolling) -- You can restrict horizontal or vertical dragging by setting drag.can_x or drag.can_y to false value -- You can get info about current drag state:

- -
-- _is_touch_ - Is currently node touching
-- _is_drag_ - Is currently node is dragging
-- _x_ and _y_ - Current touch position
-- _touch_start_pos_ - Touch stat positions
-
- -

- Drag have next events:

- -
-- _on_touch_start_ (self) - Event on touch start
-- _on_touch_end_ (self) - Event on touch end
-- _on_drag_start_ (self) - Event on drag start
-- _on_drag_ (self, dx, dy) - Event on drag process
-- _on_drag_end_ (self) - Event on drag end
-
- -

- Drag node zone can be restricted via drag:set_click_zone(node)

- - -
-
-
-generated by LDoc 1.4.6 -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 deleted file mode 100644 index 48f3bd6..0000000 --- a/docs/topics/02-creating_custom_components.md.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- - -

Creating custom components

- -

-

Overview

- -

Druid allows you to create your custom components from druid basic components or other custom components.

- -

Every component is the children of Basic Druid component. Read the [basic component API here].(https://insality.github.io/druid/modules/component.html), Methods of basic components you can call via self:{method_name}

- - -

-

Custom components

- -

Basic custom component template looks like this:

- -
-local const = require("druid.const")
-local component = require("druid.component")
-
-local M = component.create("my_component")
-
--- Component constructor
-function M.init(self, ...)
-end
-
--- Call only if exist interest: const.ON_UPDATE
-function M.update(self, dt)
-end
-
--- Call only if exist interest: const.ON_INPUT or const.ON_INPUT_HIGH
-function M.on_input(self, action_id, action)
-end
-
--- Call on component creation and on component:set_style() function
-function M.on_style_change(self, style)
-end
-
--- Call only if exist interest: const.ON_MESSAGE
-function M.on_message(self, message_id, message, sender)
-end
-
--- Call only if component with ON_ANGUAGECHANinterest
-function M.on_anguagechanself)
-end
-
--- Call only if component with ON_LAYOUT_CHANGE interest
-function M.on_layout_change(self)
-end
-
--- Call, if input was capturing before this component
--- Example: scroll is start scrolling, so you need unhover button
-function M.on_input_interrupt(self)
-end
-
--- Call, if game lost focus. Need ON_FOCUS_LOST intereset
-function M.on_focus_lost(self)
-end
-
--- Call, if game gained focus. Need ON_FOCUS_GAINED intereset
-function M.on_focus_gained(self)
-end
-
--- Call on component remove or on druid:final
-function M.on_remove(self)
-end
-
-return M
-
- - - -

Add your custom component to druid via druid.register

- -
-local druid = require("druid.druid")
-local my_component = require("my.amazing.component")
-
-function init(self)
-    druid.register("my_component", my_component)
-end
-
- - -

Registering make new function with "new{componentname}". In our example it will be: druid:new_my_component().

- -

Or you can create component without registering with druid:create(my_component_module)

- -

As component registered, you can create your component with next code:

- -
-local druid = require("druid.druid")
-local my_component = require("my.amazing.component")
-
-function init(self)
-    self.druid = druid.new(self)
-
-    local my_component = self.druid:new_my_component(...)
-    -- or --
- local my_component = self.druid:create(my_component, ...)
-end
-
- - -

Interest

-

Interest - is a way to indicate what events your component will respond to. -There is next interests in druid: -- ON_MESSAGE - component will receive messages from on_message

- -
    -
  • ON_UPDATE - component will be updated from update

  • -
  • ONINPUTHIGH - component will receive input from oninput, before other components with ONINPUT

  • -
  • ON_INPUT - component will receive input from oninput, after other components with ONINPUT_HIGH

  • -
  • ONLANGUAGECHANGE - will call onlanguagechange function on language change trigger

  • -
  • ONLAYOUTCHANGE will call onlayoutchange function on layout change trigger

  • -
  • ONFOCUSLOST will call onfocustlost function in on focus lost event. You need to pass window_callback to global druid:on_window_callback

  • -
  • ONFOCUSGAINED will call onfocustgained function in on focus gained event. You need to pass window_callback to global druid:on_window_callback

  • -
- -

-

Best practice on custom components

-

On each component recommended describe component scheme in next way:

- - -
--- Component module
-local component = require("druid.component")
-
-local M = component.create("your_component")
-
-local SCHEME = {
-    ROOT = "root",
-    ITEM = "item",
-    TITLE = "title"
-}
-
-function M.init(self, template_name, node_table)
-    -- If component use template, setup it:
- self:set_template(template_name)
-
-    -- If component was cloned with gui.clone_tree, pass his nodes
- self:set_nodes(node_table)
-
-    -- helper can get node from gui/template/table
- local root = self:get_node(SCHEME.ROOT)
-
-    -- This component can spawn another druid components:
- local druid = self:get_druid()
-
-    -- Button self on callback is self of _this_ component
- local button = druid:new_button(...)
-end
-
- - - -

-

Power of using templates

- -

You can use one component, but creating and customizing templates for them. Templates only requires to match the component scheme.

- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 -
-
- - diff --git a/docs/topics/03-styles.md.html b/docs/topics/03-styles.md.html deleted file mode 100644 index b4d8cf0..0000000 --- a/docs/topics/03-styles.md.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- - -

Styles

- -

-

Overview

-

Styles - set of functions and parameters for components to customize their behavior.

- -

Styles is a table, where key is name of component, and value is style table for this component.

- -

In component API documentation, you can find the style API for this component. Or just lookup for existing styles and modify them.

- -

-

Usage

-

Setup default druid style for all druid instances via druid.set_default_style -You can pass nil or emptytable_ to use default values for all components (no styles)

- -
-local druid = require("druid.druid")
-local my_style = require("my.amazing.style")
-
-local function init(self)
-    druid.set_default_style(my_style)
-end
-
- - -

Setup custom style to specific druid instance:

- -
-local druid = require("druid.druid")
-local my_style = require("my.amazing.style")
-
-local function init(self)
-    -- This druid instance will be use my_style as default
- self.druid = druid.new(self, my_style)
-end
-
- - -

Change component style with setstyle_ function

- -
-local druid = require("druid.druid")
-local my_style = require("my.amazing.style")
-
-local function init(self)
-    self.druid = druid.new(self)
-    self.button = self.druid:new_button(self, "node")
-    -- Setup custom style for specific component
- self.button:set_style(my_style)
-end
-
- - - -

-

Create your own styles

- -

The most components have their styles. You can explore it on Druid API in table style section (button example). Or you can see, what fields component uses in code in function on_style_change

- -

To create you style, create lua module, what return <componentname_, componentstyle_> table

- -

Example: default druid style

- -

Override all fields you want and set your style with one of next ways:

- -
    -
  • Set your style as global via druid.set_default_style
  • -
  • Set style for concrete druid instance via druid = druid.new(self, style)
  • -
  • Set style for concrete instance via component:set_style(style)
  • -
- - -
-
-
-generated by LDoc 1.4.6 -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 deleted file mode 100644 index 8270e0e..0000000 --- a/docs/topics/04-druid_assets.md.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- - -

Druid assets

- -

-

Overview

-

I've created druid-assets repository to make a marketplace with custom styles and components.

- -

Any of Druid users can push their own components and styles to share it with the other users

- -

Also, this marketplace is great example to how you can create your custom components

- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 -
-
- - diff --git a/docs/topics/05-examples.md.html b/docs/topics/05-examples.md.html deleted file mode 100644 index 140bf25..0000000 --- a/docs/topics/05-examples.md.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- - -

Examples

- -

-

Overview

-

See the example folder for examples of how to use Druid

- -

Try the HTML5 version of the example app

- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 -
-
- - diff --git a/docs/topics/README.md.html b/docs/topics/README.md.html deleted file mode 100644 index 7c0a416..0000000 --- a/docs/topics/README.md.html +++ /dev/null @@ -1,358 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

- -

GitHub release (latest by date)

- -

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.

- - -

-

Setup

- -

Dependency

- -

You can use the Druid extension in your own project by adding this project as a Defold library dependency. Open your game.project file and in the dependencies field under project add:

- -
-

https://github.com/Insality/druid/archive/master.zip

-
- -

Or point to the ZIP file of a specific release.

- -

Input bindings

- -

For Druid to work requires next input bindings:

- -
    -
  • Mouse trigger - Button 1 -> touch For basic input components
  • -
  • Key trigger - Backspace -> key_backspace For backhandler component, input component_
  • -
  • Key trigger - Back -> key_back For backhandler component, Android back button, input component_
  • -
  • Key trigger - Enter -> key_enter For input component, optional
  • -
  • Key trigger - Esc -> key_esc For input component, optional
  • -
  • Touch triggers - Touch multi -> multitouch For scroll component
  • -
- -

-

- - -

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")

- -

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

-
 [druid]
- no_auto_input = 1
-
- - -

Code [optional]

- -

Adjust Druid settings, if needed:

- -
-local druid = require("druid.druid")
-
--- Used for button component and custom components
--- Callback should play sound by name
-druid.set_sound_function(callback)
-
--- Used for lang_text component
--- Callback should return localized string by locale id
-druid.set_text_function(callback)
-
--- Used for change default druid style
-druid.set_default_style(your_style)
-
--- Call this function on language changing in the game,
--- to retranslate all lang_text components:
-druid.on_language_change()
-
--- Call this function inside window.set_listener
--- to catch game focus lost/gained callbacks:
-druid.on_window_callback(event)
-
- - - -

-

Components

- -

Druid provides next basic components:

- -
    -
  • Button - Basic Druid button input component. Handles all types of interaction (tap, long-tap, hold-tap, double-tap, simple key triggers, etc)

  • -
  • Text - Basic Druid text component. Wrap on gui text node, handle text size adjusting.

  • -
  • Scroll - Basic Druid scroll component

  • -
  • Blocker - Block input in node zone component

  • -
  • Back Handler - Handle back button (Android back button, backspace key)

  • -
  • Static Grid - Component for manage node positions with equal sizes

  • -
  • Hover - System Druid component, handle hover node state

  • -
  • Swipe - System Druid component, handle swipe gestures on node

  • -
  • Drag - System Druid component, handle drag input on node

  • -
- -

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*

- -
    -
  • Checkbox - Checkbox component

  • -
  • Checkbox group - Several checkboxes in one group

  • -
  • Dynamic Grid - Component for manage node positions with different sizes. Only in one row or column

  • -
  • Input - User text input component

  • -
  • Lang text - Wrap on Text component to handle localization

  • -
  • Progress - Progress bar component

  • -
  • Radio group - Several checkboxes in one group with single choice

  • -
  • Slider - Slider component

  • -
  • Timer - Handle timer work on gui text node

  • -
- -

Full info see on components.md

- - -

-

Basic usage

- -

For using Druid, first you should create Druid instance to spawn components. Pass to new Druid instance main engine functions: update, *onmessage* and *oninput*

- -

All Druid components as arguments can apply node name string, you can don't do gui.get_node() before

- -

All Druid and component methods calling with : like self.druid:new_button()

- - -
-local druid = require("druid.druid")
-
-local function button_callback(self)
-    print("Button was clicked!")
-end
-
-function init(self)
-    self.druid = druid.new(self)
-    self.druid:new_button("button_node_name", button_callback)
-end
-
-function final(self)
-    self.druid:final()
-end
-
-function on_input(self, action_id, action)
-    return self.druid:on_input(action_id, action)
-end
-
- - -

Learn Druid instance functions here)

- -

-

Druid Events

- -

Any Druid components as callbacks uses Druid Events. In component API (button example) pointed list of component events. You can manually subscribe on this events by next API:

- -
    -
  • event:subscribe(callback)

  • -
  • event:unsubscribe(callback)

  • -
  • event:clear()

  • -
- -

You can subscribe several callbacks on single event.

- -

-

Druid Lifecycle

- -

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

- -
-local druid = require("druid.druid")
-
-function init(self)
-    self.druid = druid.new(self)
-end
-
-function final(self)
-    self.druid:final()
-end
-
-function update(self, dt)
-    self.druid:update(dt)
-end
-
-function on_input(self, action_id, action)
-    return self.druid:on_input(action_id, action)
-end
-
-function on_message(self, message_id, message, sender)
-    self.druid:on_message(message_id, message, sender)
-end
-
- - -
    -
  • final required function for correct Druid lifecycle
  • -
  • *on_input* used for almost all Druid components
  • -
  • update used for progress bar, scroll and timer base components
  • -
  • *on_message* used for specific Druid events, like language change or layout change
  • -
- -

Recommended is fully integrate all Druid lifecycles functions

- - -

-

Details

- -
    -
  • Druid input goes as stack. Last created button will checked first. So create your GUI from back
  • -
  • Don't forget about return in on_input: return self.druid:on_input(). It need, if you have more than 1 acquire inputs (several Druid, other input system, etc)
  • -
  • Druid by default do acquireinputfocus. So you don't need do it manually. Buy only if you have components, which requires oninput_
  • -
  • If you want to delete node with declared Druid component, don't forget to remove them via druid:remove(component)
  • -
- -

See full See FAQ here

- - -

-

Examples

- -

See the example folder for examples of how to use Druid

- -

See the druid-assets repository for examples of how to create custom components and styles

- -

Try the HTML5 version of the example app

- - -

-

Documentation

- -

To learn Druid better, read next documentation: -- 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/

- - -

-

Games powered by Druid

- -

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

- - -

-

License

- - - -

MIT License

- - -

-

Issues and suggestions

- -

If you have any issues, questions or suggestions please create an issue or contact me: insality@gmail.com - -

-
-
-generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 -
-
- - diff --git a/docs/topics/changelog.md.html b/docs/topics/changelog.md.html deleted file mode 100644 index ac002f0..0000000 --- a/docs/topics/changelog.md.html +++ /dev/null @@ -1,252 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- - -

Druid 0.3.0:

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

  • -
  • Add swipe basic component

    - -
    -- Swipe component handle simple swipe gestures on node. It has single callback with direction on swipe. You can adjust a several parameters of swipe in druid style.
    -- Swipe can be triggered on action.released or while user is make swiping (in process)
    -- Add swipe example at main Druid example. Try swipe left/right to switch example pages.
    -
    -
  • -
  • Add input basic component

    - -
    -- Input component handle user text input. Input contains from button and text components. Button needed for selecting/unselecting input field
    -- Long click on input field for clear and select input field (clearing can be disable via styles)
    -- Click outside of button to unselect input field
    -- On focus lost (game minimized) input field will be unselected
    -- You can setup max length of the text
    -- You can setup allowed characters. On add not allowed characters on_input_wrong will be called. By default it cause simple shake animation
    -- The keyboard for input will not show on mobile HTML5. So input field in mobile HTML5 is not working now
    -- To make work different keyboard type, make sure value in game.project Android:InputMethod set to HiddenInputField (https://defold.com/manuals/project-settings/#input-method)
    -
    -
  • -
  • Add two functions to basic component: increase_input_priority and reset_input_priority. It used to process component input first in current input stack (there is two input stacks now: INPUT and INPUT_HIGH). Example: on selecting input field, it increase input self priority until it be unselected

  • -
  • Add two new component interests: on_focus_gain and on_focus_lost

  • -
  • Add global druid events:

    - -
    -- on_window_callback: call druid.on_window_callback(event) for on_focus_gain/lost correct work
    -- on_language_change: call druid.on_language_change() (#38) for update all druid instances lang components
    -- on_layout_change: call druid.on_layout_change() (#37) for update all gui layouts (unimplemented now)
    -
    -
  • -
  • Add button on_click_outside event. You can subscribe on this event in button. Was needed for Input component (click outside to deselect input field)

  • -
  • Add startpos_ field to button component

  • -
  • Changed input binding settings. Add esc, enter, text and marked_text. Backspace now is different from android back button event. Check the README setup section

  • -
  • Renamed onchangelanguage -> onlanguagechange component interest

  • -
  • Add several examples to druid-assets respository (see live example here): https://insality.github.io/druid-assets/)

  • -
  • Known issues:

    - -
    -- Adjusting text size by height works wrong. Adjusting single line texting works fine
    -- Space is not working in HTML5
    -
    - -

    Druid 0.4.0:

  • -
  • Add Drag basic component

    - -
    -- Drag component allow you detect dragging on GUI node
    -- Drag will be processed even the cursor is outside of node, if drag is already started
    -- Drag provides correct handle of several touches. Drag can switch between them (no more scroll gliches with position)
    -- Drag have next events:
    -    - on_touch_start (self)
    -    - on_touch_end (self)
    -    - on_drag_start (self)
    -    - on_drag (self, dx, dy)
    -    - on_drag_end (self)
    -- You can restriction side of dragging by changing _drag.can_x_ and _drag.can_y_ fields
    -- You can setup drag deadzone to detect, when dragging is started (_by default 10 pixels_)
    -
    -
  • -
  • [Breaking changes] Druid Scroll component fully reworked. Input logic moved to Drag component

    - -
    -- Update scroll documentation
    -- Change constructor order params
    -- Change _scroll:set_border_ to _scroll:set_size_
    -- Scroll now contains from view and content node
    -    - _View node_ - static node, which size determine the "camera" zone
    -    - _Content node_ - dynamic node, moving by _Scroll_ component
    -- Scroll will be disabled only if content size equals to view size (by width or height separatly)
    -- You can adjust start scroll size via _.gui_ scene. Just setup correct node size
    -- Different anchoring is supported (for easier layouting)
    -- Function _scroll_to_ now accept position relative to _content node_. It's more easier for handling. _Example:_ if you have children node of _content_node_, you can pass this node position to scroll to this.
    -- **Resolve #52**: _Content node size_ now can be less than _view node size_. In this case, content will be scrolled only inside _view size_ (can be disabled via style field: _SMALL_CONTENT_SCROLL_)
    -- **Fix #50**: If style.SOFT_ZONE_SIZE equals to [0..1], scroll can be disappeared
    -
    -
  • -
  • Druid Grid Update

    - -
    -- 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)
    -
    -
  • -
  • Druid Hover component now have two hover events (#49):

    - -
    -- _on_hover_ is usual hover event. Trigger only if touch or mouse action_id pressed on node
    -- _on_mouse_hover_ action on node without action_id (desktop mouse over). Works only on desktop platform
    -
    -
  • -
  • Styles update:

    - -
    -- Styles table now can be empty, every component have their default style values
    -- Remove component:get_style function. Now you can only set styles
    -- To get style values in component, add component:on_style_change function. It's invoked on component:set_style function
    -- You can look up default values inside component:on_style_change function or style component API on [Druid API](https://insality.github.io/druid/index.html)
    -
    -
  • -
  • Druid update:

    - -
    -- Now function druid:remove remove instance and all instance children components. No more manual deleting child components (#41)
    -
    -
  • -
  • Fix: Blocker component bug (blocker had very high priority, so it's block even button components, created after blocker)

  • -
  • Fix #58: Bug, when druid instance should be always named druid (ex: self.druid = druid.new(self))

  • -
  • Fix #53: Bug with final Druid instance without any components

  • -
- - -

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!

- -
    -
  • #77 Grid update: - -
    -- The _grid_ component now is __deprecated__. Use _static_grid_ instead. Druid will show you deprecated message, if you still using _grid_ component
    -- __[BREAKING]__ Remove the _grid:set_offset_ grid functions. To adjust the distance between nodes inside grid - setup correct node sizes
    -- Add _static_grid_ component
    -    - The behaviour like previous _grid_ component
    -    - Have constant element size, so have ability to precalculate positions, indexes and size of content
    -    - By default, not shifting elements on removing element. Add _is_shift_ flag to _static_grid:remove_ function
    -    - This grid can spawn elements with several rows and columns
    -- Add _dynamic_grid_ component
    -    - Can have different element size. So have no ability to precalculate stuff like _static_grid_
    -    - This grid can't have gaps between elements. You will get the error, if spawn element far away from other elements
    -    - The grid can spawn elements only in row or in column
    -    - The grid node should have __West__, __East__, __South__ or __North__ pivot (vertical or horizontal element placement)
    -    - Able to shift nodes left or right on _grid:add_ / _grid:remove_ functions
    -
    -
  • -
  • Scroll update: - -
    -- Add _scroll:set_vertical_scroll_ and _scroll:set_horizontal_scroll_ for disable scroll sides
    -- Add _scroll:bind_grid_ function. Now is possible to bind Druid Grid component (Static or Dynamic) to the scroll for auto refresh the scroll size on grid nodes changing
    -
    -
  • -
  • #37 Add onlayoutchange support. Druid will keep and restore GUI component data between changing game layout. Override function onlayoutchange in your custom components to do stuff you need.
  • -
  • #85 Move several components from base folder to extended. In future to use them, you have to register them manually. This is done for decrease build size by excluding unused components
  • -
  • 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: [BREAKING] Fix typo: strech -> stretch. Scroll function set_extra_stretch_size renamed
  • -
  • Fix #76: Add params for lang text localization component
  • -
  • Fix #79: Fix druid:remove inside on_input callback
  • -
  • Fix #80: Fix hover:setenable_ typo function call
  • -
  • Fix #88: Add component:setinputenabled function to enable/disable input for druid component. Now you can disable input of any druid component, even complex (with other components inside)
  • -
  • Add component.template.lua as template for Druid custom component
  • -
  • Update the example app
  • -
- - - -
-
-
-generated by LDoc 1.4.6 -Last updated 2020-09-29 23:46:16 -
-
- - diff --git a/docs/topics/components.md.html b/docs/topics/components.md.html deleted file mode 100644 index a8c9c0a..0000000 --- a/docs/topics/components.md.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- - -

Druid components

- -

-

Button

-

Basic game button

- -

-

Text

-

Wrap on text node with text size adjusting

- -

-

Blocker

-

Block input in node zone

- -

-

Back Handler

-

Handle back button (Android, backspace)

- -

-

Locale

-

Text component with handle localization system

- -

-

Timer

-

Run timer on text node

- -

-

Progress

-

Basic progress bar

- -

-

Scroll

-

Basic scroll component

- -

-

Grid

-

Component for manage node positions

- -

-

Slider

-

Basic slider component

- -

-

Checkbox

-

Basic checkbox component

- -

-

Checkbox group

-

Several checkboxes in one group

- -

-

Radio group

-

Several checkboxes in one group with single choice

- -

-

Hover

-

Trigger component for check node hover state

- -

-

Input

-

Component to process user text input

- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2020-03-21 22:59:46 -
-
- - diff --git a/docs/topics/create_custom_components.md.html b/docs/topics/create_custom_components.md.html deleted file mode 100644 index 758f9c9..0000000 --- a/docs/topics/create_custom_components.md.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- - -

Custom components

- -

Add your custom components via druid.register

- -
-local druid = require("druid.druid")
-local my_component = require("my.amazing.component")
-
-local function init(self)
-    druid.register("my_component", my_component)
-end
-
- - -

Basic custom component template looks like this:

- -
-local const = require("druid.const")
-
-local M = {}
-M.interest = { const.ON_INPUT }
-
-function M.init(self, ...)
-    -- Component constructor
-end
-
--- Call only if exist interest: const.ON_UPDATE
-function M.update(self, dt)
-
-end
-
--- Call only if exist interest: const.ON_INPUT or const.ON_SWIPE
-function M.on_input(self, action_id, action)
-
-end
-
--- Call only if exist interest: const.ON_MESSAGE
-function M.on_message(self, message_id, message, sender)
-
-end
-
--- Call only if swipe was started on another component (ex. scroll)
-function M.on_swipe(self)
-
-end
-
-return M
-
- - - -

Best practice on custom components

-

On each component recomended describe component schema in next way:

- - -
--- Component module
-local helper = require("druid.helper")
-
-local M = {}
-
-local SCHEME = {
-    ROOT = "/root",
-    ITEM = "/item",
-    TITLE = "/title"
-}
-
--- TODO: Rework self.template/self.nodes
--- Make self._inner_data? { component_name, template, nodes }
-function M.init(self, template_name, node_table)
-    -- If component use template, setup it:
- self.template = template_name
-
-    -- If component was cloned with gui.clone_tree, pass his nodes
- self.nodes = node_table
-
-    -- helper can get node from gui/template/table
- local root = helper.node(self, SCHEME.ROOT)
-
-    -- This component can spawn another druid components:
- local druid = helper.get_druid(self)
-    -- Button self on callback is self of _this_ component
- local button = druid:new_button(...)
-
-    -- helper can return you the component style
- local my_style = helper.get_style(self, "component_name")
-end
-
- - - -
-
-
-generated by LDoc 1.4.6 -Last updated 2020-03-21 22:00:04 -
-
- - diff --git a/docs/topics/creating_custom_components.md.html b/docs/topics/creating_custom_components.md.html deleted file mode 100644 index 67d997b..0000000 --- a/docs/topics/creating_custom_components.md.html +++ /dev/null @@ -1,200 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- - -

Creating custom components

- -

-

Overview

-

Druid allows you to create your custom components from druid basic components or other custom components

- - -

-

Custom components

-

Basic custom component template looks like this:

- -
-local const = require("druid.const")
-local component = require("druid.component")
-
-local M = component.create("your_component")
-
--- Component constructor
-function M.init(self, ...)
-end
-
--- Call only if exist interest: const.ON_UPDATE
-function M.update(self, dt)
-end
-
--- Call only if exist interest: const.ON_INPUT or const.ON_INPUT_HIGH
-function M.on_input(self, action_id, action)
-end
-
--- Call only if exist interest: const.ON_MESSAGE
-function M.on_message(self, message_id, message, sender)
-end
-
--- Call only if component with ON_CHANGE_LANGUAGE interest
-function M.on_change_language(self)
-end
-
--- Call only if component with ON_LAYOUT_CHANGE interest
-function M.on_layout_change(self)
-end
-
-return M
-
- - - -

Add your custom component to druid via druid.register

- -
-local druid = require("druid.druid")
-local my_component = require("my.amazing.component")
-
-local function init(self)
-    druid.register("my_component", my_component)
-end
-
- - -

Interest

-

Interest - is a way to indicate what events your component will respond to. -There is next interests in druid: -- ON_MESSAGE - component will receive messages from on_message

- -
    -
  • ON_UPDATE - component will be updated from update

  • -
  • ONINPUTHIGH - component will receive input from oninput, before other components with ONINPUT

  • -
  • ON_INPUT - component will receive input from oninput, after other components with ONINPUT_HIGH

  • -
  • ONCHANGELANGUAGE - will call onchangelanguage function on language change trigger

  • -
  • ONLAYOUTCHANGED will call onlayoutchange function on layout change trigger

  • -
- - -

-

Best practice on custom components

-

On each component recomended describe component scheme in next way:

- - -
--- Component module
-local component = require("druid.component")
-
-local M = component.create("your_component")
-
-local SCHEME = {
-    ROOT = "/root",
-    ITEM = "/item",
-    TITLE = "/title"
-}
-
-function M.init(self, template_name, node_table)
-    -- If component use template, setup it:
- self:set_template(template_name)
-
-    -- If component was cloned with gui.clone_tree, pass his nodes
- self:set_nodes(node_table)
-
-    -- helper can get node from gui/template/table
- local root = self:get_node(SCHEME.ROOT)
-
-    -- This component can spawn another druid components:
- local druid = self:get_druid()
-
-    -- Button self on callback is self of _this_ component
- local button = druid:new_button(...)
-
-    -- helper can return you the component style for current component
- -- It return by component name from
- local my_style = self:get_style()
-end
-
- - - -
-
-
-generated by LDoc 1.4.6 -Last updated 2020-03-21 22:59:46 -
-
- - diff --git a/docs/topics/druid_assets.md.html b/docs/topics/druid_assets.md.html deleted file mode 100644 index b45f35a..0000000 --- a/docs/topics/druid_assets.md.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- - -

Druid assets

- -

-

Overview

-

I've created druid-assets repository to make a marketplace with custom styles and components.

- -

Any of druid users can push their own components and styles to share it with the other users

- -

Also, this marketplace is great example to how you can create your custom components

- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2020-03-21 22:59:46 -
-
- - diff --git a/docs/topics/examples.md.html b/docs/topics/examples.md.html deleted file mode 100644 index dafc08b..0000000 --- a/docs/topics/examples.md.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- - -

Examples

- -

-

Overview

-

See the example folder for examples of how to use Druid

- -

Try the HTML5 version of the example app

- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2020-03-21 22:59:46 -
-
- - diff --git a/docs/topics/faq.md.html b/docs/topics/faq.md.html deleted file mode 100644 index c2e535f..0000000 --- a/docs/topics/faq.md.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - - 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/topics/online_example.md.html b/docs/topics/online_example.md.html deleted file mode 100644 index b057b31..0000000 --- a/docs/topics/online_example.md.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- - -

Online example

- -

Check druid --here-- (link)

- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2020-03-21 22:00:04 -
-
- - diff --git a/docs/topics/styles.md.html b/docs/topics/styles.md.html deleted file mode 100644 index 9c680d6..0000000 --- a/docs/topics/styles.md.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - Defold Druid UI Library - - - - -
- -
- -
-
-
- - -
- - - - - - -
- - -

Styles

- -

-

Overview

-

Styles - set of functions and parameters for components to customize their behavior.

- -

Styles is a table, where key is name of component, and value is style table for this component.

- -

In component API documentation, you can find the style API for this component. Or just lookup for existing styles and modify them.

- -

-

Usage

-

Setup default druid style for all druid instances via druid.set_default_style

- -
-local druid = require("druid.druid")
-local my_style = require("my.amazing.style")
-
-local function init(self)
-    druid.set_default_style(my_style)
-end
-
- - -

Setup custom style to specific druid instance:

- -
-local druid = require("druid.druid")
-local my_style = require("my.amazing.style")
-
-local function init(self)
-    -- This druid instance will be use my_style as default
- self.druid = druid.new(self, my_style)
-end
-
- - -

Change component style with setstyle_ function

- -
-local druid = require("druid.druid")
-local my_style = require("my.amazing.style")
-
-local function init(self)
-    self.druid = druid.new(self)
-    self.button = self.druid:new_button(self, "node")
-    -- Setup custom style for specific component
- self.button:set_style(my_style)
-end
-
- - -

-

Create custom components

-

Styles is just lua table, so it can be described in just one single file -TODO

- - -
-
-
-generated by LDoc 1.4.6 -Last updated 2020-03-21 22:59:46 -
-
- - diff --git a/druid/system/druid_instance.lua b/druid/system/druid_instance.lua index a5f6562..fba35bf 100644 --- a/druid/system/druid_instance.lua +++ b/druid/system/druid_instance.lua @@ -350,7 +350,7 @@ end --- Create button basic component -- @tparam DruidInstance self -- @tparam args ... button init args --- @treturn Component button component +-- @treturn Button button component function DruidInstance.new_button(self, ...) return DruidInstance.create(self, button, ...) end @@ -359,7 +359,7 @@ end --- Create blocker basic component -- @tparam DruidInstance self -- @tparam args ... blocker init args --- @treturn Component blocker component +-- @treturn Blocker blocker component function DruidInstance.new_blocker(self, ...) return DruidInstance.create(self, blocker, ...) end @@ -368,7 +368,7 @@ end --- Create back_handler basic component -- @tparam DruidInstance self -- @tparam args ... back_handler init args --- @treturn Component back_handler component +-- @treturn BackHandler back_handler component function DruidInstance.new_back_handler(self, ...) return DruidInstance.create(self, back_handler, ...) end @@ -377,7 +377,7 @@ end --- Create hover basic component -- @tparam DruidInstance self -- @tparam args ... hover init args --- @treturn Component hover component +-- @treturn Hover hover component function DruidInstance.new_hover(self, ...) return DruidInstance.create(self, hover, ...) end @@ -386,7 +386,7 @@ end --- Create text basic component -- @tparam DruidInstance self -- @tparam args ... text init args --- @treturn Component text component +-- @treturn Tet text component function DruidInstance.new_text(self, ...) return DruidInstance.create(self, text, ...) end @@ -396,7 +396,7 @@ end -- Deprecated -- @tparam DruidInstance self -- @tparam args ... grid init args --- @treturn Component grid component +-- @treturn StaticGrid grid component function DruidInstance.new_grid(self, ...) helper.deprecated("The druid:new_grid is deprecated. Please use druid:new_static_grid instead") return DruidInstance.create(self, static_grid, ...) @@ -406,7 +406,7 @@ end --- Create static grid basic component -- @tparam DruidInstance self -- @tparam args ... grid init args --- @treturn Component grid component +-- @treturn StaticGrid grid component function DruidInstance.new_static_grid(self, ...) return DruidInstance.create(self, static_grid, ...) end @@ -415,7 +415,7 @@ end --- Create scroll basic component -- @tparam DruidInstance self -- @tparam args ... scroll init args --- @treturn Component scroll component +-- @treturn Scroll scroll component function DruidInstance.new_scroll(self, ...) return DruidInstance.create(self, scroll, ...) end @@ -424,7 +424,7 @@ end --- Create swipe basic component -- @tparam DruidInstance self -- @tparam args ... swipe init args --- @treturn Component swipe component +-- @treturn Swipe swipe component function DruidInstance.new_swipe(self, ...) return DruidInstance.create(self, swipe, ...) end @@ -433,7 +433,7 @@ end --- Create drag basic component -- @tparam DruidInstance self -- @tparam args ... drag init args --- @treturn Componetn drag component +-- @treturn Drag drag component function DruidInstance.new_drag(self, ...) return DruidInstance.create(self, drag, ...) end @@ -442,7 +442,7 @@ end --- Create dynamic grid component -- @tparam DruidInstance self -- @tparam args ... grid init args --- @treturn Component grid component +-- @treturn DynamicGrid grid component function DruidInstance.new_dynamic_grid(self, ...) -- return helper.extended_component("dynamic_grid") return DruidInstance.create(self, dynamic_grid, ...) @@ -452,7 +452,7 @@ end --- Create lang_text component -- @tparam DruidInstance self -- @tparam args ... lang_text init args --- @treturn Component lang_text component +-- @treturn LangText lang_text component function DruidInstance.new_lang_text(self, ...) -- return helper.extended_component("lang_text") return DruidInstance.create(self, lang_text, ...) @@ -462,7 +462,7 @@ end --- Create slider component -- @tparam DruidInstance self -- @tparam args ... slider init args --- @treturn Component slider component +-- @treturn Slider slider component function DruidInstance.new_slider(self, ...) -- return helper.extended_component("slider") return DruidInstance.create(self, slider, ...) @@ -472,7 +472,7 @@ end --- Create checkbox component -- @tparam DruidInstance self -- @tparam args ... checkbox init args --- @treturn Component checkbox component +-- @treturn Checkbox checkbox component function DruidInstance.new_checkbox(self, ...) -- return helper.extended_component("checkbox") return DruidInstance.create(self, checkbox, ...) @@ -482,7 +482,7 @@ end --- Create input component -- @tparam DruidInstance self -- @tparam args ... input init args --- @treturn Component input component +-- @treturn Input input component function DruidInstance.new_input(self, ...) -- return helper.extended_component("input") return DruidInstance.create(self, input, ...) @@ -492,7 +492,7 @@ end --- Create checkbox_group component -- @tparam DruidInstance self -- @tparam args ... checkbox_group init args --- @treturn Component checkbox_group component +-- @treturn CheckboxGroup checkbox_group component function DruidInstance.new_checkbox_group(self, ...) -- return helper.extended_component("checkbox_group") return DruidInstance.create(self, checkbox_group, ...) @@ -502,7 +502,7 @@ end --- Create radio_group component -- @tparam DruidInstance self -- @tparam args ... radio_group init args --- @treturn Component radio_group component +-- @treturn RadioGroup radio_group component function DruidInstance.new_radio_group(self, ...) -- return helper.extended_component("radio_group") return DruidInstance.create(self, radio_group, ...) @@ -512,7 +512,7 @@ end --- Create timer component -- @tparam DruidInstance self -- @tparam args ... timer init args --- @treturn Component timer component +-- @treturn Timer timer component function DruidInstance.new_timer(self, ...) -- return helper.extended_component("timer") return DruidInstance.create(self, timer, ...) @@ -522,7 +522,7 @@ end --- Create progress component -- @tparam DruidInstance self -- @tparam args ... progress init args --- @treturn Component progress component +-- @treturn Progress progress component function DruidInstance.new_progress(self, ...) -- return helper.extended_component("progress") return DruidInstance.create(self, progress, ...)