diff --git a/README.md b/README.md index 10e2ecf..392496e 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ For all **Druid** instance functions, [see here](https://insality.github.io/drui **Druid** offers a wide range of components and functions. To facilitate usage, **Druid** provides comprehensive API documentation with examples and annotations. -Start reading the API documentation [here](hhttps://insality.github.io/druid/modules/Druid.html). +Start reading the API documentation [here](https://insality.github.io/druid/modules/Druid.html). ### EmmyLua Annotations [optional] diff --git a/druid/base/back_handler.lua b/druid/base/back_handler.lua index 15b8de6..93fe989 100644 --- a/druid/base/back_handler.lua +++ b/druid/base/back_handler.lua @@ -1,12 +1,12 @@ -- Copyright (c) 2023 Maksim Tuprikov . This code is licensed under MIT license --- Component with event on back and backspace button. --- # Overview # +-- # Overview # -- -- Back Handler is recommended to put in every game window to close it -- or in main screen to call settings window. -- --- # Notes # +-- # Notes # -- -- • Back Handler inheritance @{BaseComponent}, you can use all of its methods in addition to those described here. -- diff --git a/druid/base/blocker.lua b/druid/base/blocker.lua index 4905280..16a906e 100644 --- a/druid/base/blocker.lua +++ b/druid/base/blocker.lua @@ -1,9 +1,9 @@ -- Copyright (c) 2023 Maksim Tuprikov . This code is licensed under MIT license --- Component to consume input in special zone defined by GUI node. --- # Overview # +-- # Overview # -- --- # Notes # +-- # Notes # -- -- Blocker consume input if `gui.pick_node` works on it. -- diff --git a/druid/base/button.lua b/druid/base/button.lua index 9fcb62e..f21da7f 100755 --- a/druid/base/button.lua +++ b/druid/base/button.lua @@ -2,12 +2,12 @@ --- Druid Component for Handling User Click Interactions: Click, Long Click, Double Click, and More. -- --- # Overview # +-- # Overview # -- -- This component provides a versatile solution for handling user click interactions. -- It allows you to make any GUI node clickable and define various callbacks for different types of clicks. -- --- # Notes # +-- # Notes # -- -- • The click callback will not trigger if the cursor moves outside the node's -- area between the pressed and released states. diff --git a/druid/base/scroll.lua b/druid/base/scroll.lua index 0abd002..294fd05 100755 --- a/druid/base/scroll.lua +++ b/druid/base/scroll.lua @@ -1,7 +1,7 @@ -- Copyright (c) 2021 Maksim Tuprikov . This code is licensed under MIT license --- Component to handle scroll content. --- # Overview # +-- # Overview # -- -- The Scroll component is designed to handle scrollable content and consists of two nodes: the scroll parent and the scroll input. -- @@ -12,7 +12,7 @@ -- The initial scroll size can be set by adjusting the size of the scroll parent. -- If the size of the scroll parent is smaller than the scroll input size, scrolling is not available. -- --- # Notes # +-- # Notes # -- -- • By default, the scroll style includes inertia and extra size for a stretching effect. -- These settings can be adjusted using the scroll style settings. diff --git a/druid/custom/rich_text/rich_text.lua b/druid/custom/rich_text/rich_text.lua index 54073ce..8bcc6e2 100644 --- a/druid/custom/rich_text/rich_text.lua +++ b/druid/custom/rich_text/rich_text.lua @@ -1,9 +1,15 @@ -- Copyright (c) 2022 Maksim Tuprikov . This code is licensed under MIT license --- Druid Rich Text custom component. --- # Overview # +-- # Overview # -- --- # Notes # +-- Heavily inspired by https://github.com/britzl/defold-richtext. +-- +-- Uses the same syntax for tags, but currently have less tags support. +-- +-- # Notes # +-- +-- • Nested tags are supported -- -- @usage -- local RichText = require("druid.custom.rich_text.rich_text") @@ -57,6 +63,49 @@ end -- @tparam string text The text to set -- @treturn table words -- @treturn table line_metrics +-- @usage +-- • color: Change text color +-- +-- Foobar +-- Foobar +-- Foobar +-- Foobar +-- +-- • shadow: Change text shadow +-- +-- Foobar +-- Foobar +-- Foobar +-- Foobar +-- +-- • outline: Change text shadow +-- +-- Foobar +-- Foobar +-- Foobar +-- Foobar +-- +-- • font: Change font +-- +-- Foobar +-- +-- • size: Change text size, relative to default size +-- +-- Twice as large +-- +-- • br: Insert a line break +-- +--
+-- +-- • nobr: Prevent the text from breaking +-- +-- Words inside tag won't break +-- +-- • img: Display image +-- +-- +-- +-- function RichText.set_text(self, text) self:clean() diff --git a/druid/druid.lua b/druid/druid.lua index 7132e5e..fffe0c5 100644 --- a/druid/druid.lua +++ b/druid/druid.lua @@ -1,7 +1,7 @@ -- Copyright (c) 2021 Maksim Tuprikov . This code is licensed under MIT license --- Druid UI Component Framework. --- # Overview # +-- # Overview # -- -- Druid - powerful Defold component UI library. Use basic and extended -- Druid components or make your own game-specific components to make @@ -9,7 +9,7 @@ -- -- To start using Druid, please refer to the Basic Usage section below. -- --- # Tech Info # +-- # Notes # -- -- • Each Druid instance maintains the self context from the constructor and passes it to each Druid callback. -- diff --git a/druid/extended/lang_text.lua b/druid/extended/lang_text.lua index b1841fa..af36877 100755 --- a/druid/extended/lang_text.lua +++ b/druid/extended/lang_text.lua @@ -2,7 +2,7 @@ --- Component to wrap over GUI Text nodes with localization helpers -- --- ## Overview ## +-- # Overview # -- -- • The initialization of druid.set_text_function is required to enable localization -- using the localization ID. @@ -10,7 +10,7 @@ -- • The LangText component supports up to 7 string format parameters. -- This limitation exists due to certain issues with using ... arguments. -- --- ## Notes ## +-- # Notes # -- -- @module LangText -- @within BaseComponent diff --git a/druid/extended/progress.lua b/druid/extended/progress.lua index 227e9f3..ddd2081 100644 --- a/druid/extended/progress.lua +++ b/druid/extended/progress.lua @@ -1,9 +1,9 @@ -- Copyright (c) 2021 Maksim Tuprikov . This code is licensed under MIT license --- Druid component to handle the progress bars. --- # Overview # +-- # Overview # -- --- # Notes # +-- # Notes # -- -- • Progress Node should be fully filled in your GUI scene node. It will be the progress maximum size -- diff --git a/druid/system/druid_instance.lua b/druid/system/druid_instance.lua index 7f1a45b..862586e 100755 --- a/druid/system/druid_instance.lua +++ b/druid/system/druid_instance.lua @@ -6,7 +6,7 @@ -- -- For a list of all available components, please refer to the "See Also" section. -- --- # Notes # +-- # Notes # -- -- Please review the following API pages: --