From 2cfc6e477e545b392e2f748e62b0660344ebe658 Mon Sep 17 00:00:00 2001 From: Insality Date: Mon, 13 Apr 2020 19:36:32 +0300 Subject: [PATCH] Update docs --- docs/index.html | 2 +- docs/modules/component.html | 2 +- docs/modules/druid.back_handler.html | 2 +- docs/modules/druid.blocker.html | 2 +- docs/modules/druid.button.html | 2 +- docs/modules/druid.checkbox.html | 2 +- docs/modules/druid.checkbox_group.html | 2 +- docs/modules/druid.grid.html | 2 +- docs/modules/druid.helper.html | 2 +- docs/modules/druid.hover.html | 2 +- docs/modules/druid.html | 2 +- docs/modules/druid.input.html | 2 +- docs/modules/druid.lang_text.html | 2 +- docs/modules/druid.progress.html | 2 +- docs/modules/druid.radio_group.html | 2 +- docs/modules/druid.scroll.html | 2 +- docs/modules/druid.slider.html | 2 +- docs/modules/druid.text.html | 2 +- docs/modules/druid.timer.html | 2 +- docs/modules/druid_event.html | 2 +- docs/modules/druid_instance.html | 2 +- docs/topics/01-components.md.html | 7 ++-- .../02-creating_custom_components.md.html | 16 ++++++-- docs/topics/03-styles.md.html | 2 +- docs/topics/04-druid_assets.md.html | 2 +- docs/topics/05-examples.md.html | 2 +- docs/topics/README.md.html | 40 ++++++------------- docs_md/01-components.md | 3 +- docs_md/02-creating_custom_components.md | 14 +++++-- 29 files changed, 66 insertions(+), 62 deletions(-) diff --git a/docs/index.html b/docs/index.html index f70f2e4..87c1f53 100644 --- a/docs/index.html +++ b/docs/index.html @@ -185,7 +185,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/modules/component.html b/docs/modules/component.html index 1f148a1..4e3c79a 100644 --- a/docs/modules/component.html +++ b/docs/modules/component.html @@ -440,7 +440,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/modules/druid.back_handler.html b/docs/modules/druid.back_handler.html index c80f183..31faacf 100644 --- a/docs/modules/druid.back_handler.html +++ b/docs/modules/druid.back_handler.html @@ -215,7 +215,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/modules/druid.blocker.html b/docs/modules/druid.blocker.html index 6c15349..792519a 100644 --- a/docs/modules/druid.blocker.html +++ b/docs/modules/druid.blocker.html @@ -234,7 +234,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/modules/druid.button.html b/docs/modules/druid.button.html index e08067f..956c98c 100644 --- a/docs/modules/druid.button.html +++ b/docs/modules/druid.button.html @@ -404,7 +404,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/modules/druid.checkbox.html b/docs/modules/druid.checkbox.html index 8364f00..013ee8a 100644 --- a/docs/modules/druid.checkbox.html +++ b/docs/modules/druid.checkbox.html @@ -277,7 +277,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/modules/druid.checkbox_group.html b/docs/modules/druid.checkbox_group.html index 2c63f9a..bf11124 100644 --- a/docs/modules/druid.checkbox_group.html +++ b/docs/modules/druid.checkbox_group.html @@ -239,7 +239,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/modules/druid.grid.html b/docs/modules/druid.grid.html index b5564b9..9bec5e2 100644 --- a/docs/modules/druid.grid.html +++ b/docs/modules/druid.grid.html @@ -370,7 +370,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/modules/druid.helper.html b/docs/modules/druid.helper.html index dbfbaf8..9ddb960 100644 --- a/docs/modules/druid.helper.html +++ b/docs/modules/druid.helper.html @@ -236,7 +236,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/modules/druid.hover.html b/docs/modules/druid.hover.html index 81a6999..f2b29ac 100644 --- a/docs/modules/druid.hover.html +++ b/docs/modules/druid.hover.html @@ -211,7 +211,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/modules/druid.html b/docs/modules/druid.html index 6901a78..3bb74e7 100644 --- a/docs/modules/druid.html +++ b/docs/modules/druid.html @@ -181,7 +181,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/modules/druid.input.html b/docs/modules/druid.input.html index eb2c15a..0334fd1 100644 --- a/docs/modules/druid.input.html +++ b/docs/modules/druid.input.html @@ -86,7 +86,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/modules/druid.lang_text.html b/docs/modules/druid.lang_text.html index 80038b0..ba2169c 100644 --- a/docs/modules/druid.lang_text.html +++ b/docs/modules/druid.lang_text.html @@ -240,7 +240,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/modules/druid.progress.html b/docs/modules/druid.progress.html index 0479611..841692c 100644 --- a/docs/modules/druid.progress.html +++ b/docs/modules/druid.progress.html @@ -379,7 +379,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/modules/druid.radio_group.html b/docs/modules/druid.radio_group.html index fd5cb47..6fb9890 100644 --- a/docs/modules/druid.radio_group.html +++ b/docs/modules/druid.radio_group.html @@ -239,7 +239,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/modules/druid.scroll.html b/docs/modules/druid.scroll.html index 1d7045d..0b34dc6 100644 --- a/docs/modules/druid.scroll.html +++ b/docs/modules/druid.scroll.html @@ -507,7 +507,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/modules/druid.slider.html b/docs/modules/druid.slider.html index 89ccf5b..077bdb9 100644 --- a/docs/modules/druid.slider.html +++ b/docs/modules/druid.slider.html @@ -278,7 +278,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/modules/druid.text.html b/docs/modules/druid.text.html index 1cd2d9e..32ed971 100644 --- a/docs/modules/druid.text.html +++ b/docs/modules/druid.text.html @@ -352,7 +352,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/modules/druid.timer.html b/docs/modules/druid.timer.html index d89517a..1c73f4b 100644 --- a/docs/modules/druid.timer.html +++ b/docs/modules/druid.timer.html @@ -293,7 +293,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/modules/druid_event.html b/docs/modules/druid_event.html index ec448eb..25f3c52 100644 --- a/docs/modules/druid_event.html +++ b/docs/modules/druid_event.html @@ -239,7 +239,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/modules/druid_instance.html b/docs/modules/druid_instance.html index 40abbe6..d08a246 100644 --- a/docs/modules/druid_instance.html +++ b/docs/modules/druid_instance.html @@ -769,7 +769,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/topics/01-components.md.html b/docs/topics/01-components.md.html index 2a2afb2..3fdaf17 100644 --- a/docs/topics/01-components.md.html +++ b/docs/topics/01-components.md.html @@ -124,7 +124,8 @@ Where node name is name of node from GUI scene. You can use node_namet trigger if callback is empty -

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

- 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

@@ -137,7 +138,7 @@ Where node name is name of node from GUI scene. You can use node_nameBasic 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])

+

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

@@ -373,7 +374,7 @@ Key is value from druid const: const.SIDE.X (or just "x") or const.SIDE.Y (or ju
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/topics/02-creating_custom_components.md.html b/docs/topics/02-creating_custom_components.md.html index 30efb0f..6880c7f 100644 --- a/docs/topics/02-creating_custom_components.md.html +++ b/docs/topics/02-creating_custom_components.md.html @@ -82,7 +82,9 @@

Overview

-

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

+

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}

@@ -94,7 +96,7 @@ local const = require("druid.const") local component = require("druid.component") -local M = component.create("name_your_component") +local M = component.create("my_component") -- Component constructor function M.init(self, ...) @@ -146,16 +148,22 @@ -

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

+

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
 
@@ -225,7 +233,7 @@ There is next interests in druid:
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/topics/03-styles.md.html b/docs/topics/03-styles.md.html index 259f54d..d632be3 100644 --- a/docs/topics/03-styles.md.html +++ b/docs/topics/03-styles.md.html @@ -138,7 +138,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/topics/04-druid_assets.md.html b/docs/topics/04-druid_assets.md.html index 85d8667..3d87441 100644 --- a/docs/topics/04-druid_assets.md.html +++ b/docs/topics/04-druid_assets.md.html @@ -89,7 +89,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/topics/05-examples.md.html b/docs/topics/05-examples.md.html index ba040e2..5531e13 100644 --- a/docs/topics/05-examples.md.html +++ b/docs/topics/05-examples.md.html @@ -87,7 +87,7 @@
generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
diff --git a/docs/topics/README.md.html b/docs/topics/README.md.html index 02732fa..197a296 100644 --- a/docs/topics/README.md.html +++ b/docs/topics/README.md.html @@ -41,7 +41,6 @@
  • Examples
  • Documentation
  • Games powered by Druid
  • -
  • Future plans
  • License
  • Issues and suggestions
  • @@ -156,19 +155,19 @@
    • Button - Basic Druid input component

    • Text - Basic Druid text component

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

    • -
    • Scroll - Basic Druid scroll component

    • -
    • Progress - Basic Druid progress bar component

    • -
    • Slider - Basic Druid slider component

    • -
    • Input - Basic Druid text input component (unimplemented)

    • -
    • Checkbox - Basic Druid checkbox component

    • -
    • Checkbox group - Several checkboxes in one group

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

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

    • +
    • Scroll - Basic Druid scroll component

    • +
    • Progress - Basic Druid progress bar component

    • +
    • Slider - Basic Druid slider component

    • +
    • Input - Basic Druid text input component (unimplemented)

    • +
    • Checkbox - Basic Druid checkbox component

    • +
    • Checkbox group - Several checkboxes in one group

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

    • Blocker - Block input in node zone component

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

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

    • -
    • Grid - Component for manage node positions

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

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

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

    • +
    • Grid - Component for manage node positions

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

    Full info see on components.md

    @@ -294,19 +293,6 @@ https://insality.github.io/druid/

    Will fill later

    -

    -

    Future plans

    - -
      -
    • Basic input component

    • -
    • Add onlayoutchange support (to keep gui data between layout change)

    • -
    • Add onchangelanguage support (call single function to update all Druid instance)

    • -
    • Unit tests

    • -
    • Better documentation and examples

    • -
    • Add more comfortable gamepad support for GUI (ability to select button with DPAD and other stuff)

    • -
    - -

    License

    @@ -328,7 +314,7 @@ https://insality.github.io/druid/

    generated by LDoc 1.4.6 -Last updated 2020-04-09 22:11:32 +Last updated 2020-04-13 19:36:00
    diff --git a/docs_md/01-components.md b/docs_md/01-components.md index 28e427e..25aafcb 100644 --- a/docs_md/01-components.md +++ b/docs_md/01-components.md @@ -25,6 +25,7 @@ Where node name is name of node from GUI scene. You can use `node_name` as input - **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 +- 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` @@ -37,7 +38,7 @@ Where node name is name of node from GUI scene. You can use `node_name` as input 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])` +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_ diff --git a/docs_md/02-creating_custom_components.md b/docs_md/02-creating_custom_components.md index 0b05e9e..f163c5c 100644 --- a/docs_md/02-creating_custom_components.md +++ b/docs_md/02-creating_custom_components.md @@ -2,7 +2,9 @@ ## Overview -Druid allows you to create your custom components from druid basic components or other custom components. Read the [basic component API here].(https://insality.github.io/druid/modules/component.html) +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 @@ -12,7 +14,7 @@ Basic custom component template looks like this: local const = require("druid.const") local component = require("druid.component") -local M = component.create("name_your_component") +local M = component.create("my_component") -- Component constructor function M.init(self, ...) @@ -61,15 +63,21 @@ function init(self) end ``` -Registering make new function with "new_{component_name}". In our example it will be: `druid:new_my_component()` +Registering make new function with "new_{component_name}". 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: ```lua 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 ```