mirror of
https://github.com/Insality/druid
synced 2025-06-27 18:37:45 +02:00
Update docs
This commit is contained in:
parent
bdacd4a440
commit
6ed48772a3
@ -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.
|
**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]
|
### EmmyLua Annotations [optional]
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
-- Copyright (c) 2023 Maksim Tuprikov <insality@gmail.com>. This code is licensed under MIT license
|
-- Copyright (c) 2023 Maksim Tuprikov <insality@gmail.com>. This code is licensed under MIT license
|
||||||
|
|
||||||
--- Component with event on back and backspace button.
|
--- Component with event on back and backspace button.
|
||||||
-- # Overview #
|
-- <b># Overview #</b>
|
||||||
--
|
--
|
||||||
-- Back Handler is recommended to put in every game window to close it
|
-- Back Handler is recommended to put in every game window to close it
|
||||||
-- or in main screen to call settings window.
|
-- or in main screen to call settings window.
|
||||||
--
|
--
|
||||||
-- # Notes #
|
-- <b># Notes #</b>
|
||||||
--
|
--
|
||||||
-- • Back Handler inheritance @{BaseComponent}, you can use all of its methods in addition to those described here.
|
-- • Back Handler inheritance @{BaseComponent}, you can use all of its methods in addition to those described here.
|
||||||
--
|
--
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
-- Copyright (c) 2023 Maksim Tuprikov <insality@gmail.com>. This code is licensed under MIT license
|
-- Copyright (c) 2023 Maksim Tuprikov <insality@gmail.com>. This code is licensed under MIT license
|
||||||
|
|
||||||
--- Component to consume input in special zone defined by GUI node.
|
--- Component to consume input in special zone defined by GUI node.
|
||||||
-- # Overview #
|
-- <b># Overview #</b>
|
||||||
--
|
--
|
||||||
-- # Notes #
|
-- <b># Notes #</b>
|
||||||
--
|
--
|
||||||
-- Blocker consume input if `gui.pick_node` works on it.
|
-- Blocker consume input if `gui.pick_node` works on it.
|
||||||
--
|
--
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
--- Druid Component for Handling User Click Interactions: Click, Long Click, Double Click, and More.
|
--- Druid Component for Handling User Click Interactions: Click, Long Click, Double Click, and More.
|
||||||
--
|
--
|
||||||
-- # Overview #
|
-- <b># Overview #</b>
|
||||||
--
|
--
|
||||||
-- This component provides a versatile solution for handling user click interactions.
|
-- 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.
|
-- It allows you to make any GUI node clickable and define various callbacks for different types of clicks.
|
||||||
--
|
--
|
||||||
-- # Notes #
|
-- <b># Notes #</b>
|
||||||
--
|
--
|
||||||
-- • The click callback will not trigger if the cursor moves outside the node's
|
-- • The click callback will not trigger if the cursor moves outside the node's
|
||||||
-- area between the pressed and released states.
|
-- area between the pressed and released states.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
-- Copyright (c) 2021 Maksim Tuprikov <insality@gmail.com>. This code is licensed under MIT license
|
-- Copyright (c) 2021 Maksim Tuprikov <insality@gmail.com>. This code is licensed under MIT license
|
||||||
|
|
||||||
--- Component to handle scroll content.
|
--- Component to handle scroll content.
|
||||||
-- # Overview #
|
-- <b># Overview #</b>
|
||||||
--
|
--
|
||||||
-- The Scroll component is designed to handle scrollable content and consists of two nodes: the scroll parent and the scroll input.
|
-- 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.
|
-- 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.
|
-- If the size of the scroll parent is smaller than the scroll input size, scrolling is not available.
|
||||||
--
|
--
|
||||||
-- # Notes #
|
-- <b># Notes #</b>
|
||||||
--
|
--
|
||||||
-- • By default, the scroll style includes inertia and extra size for a stretching effect.
|
-- • By default, the scroll style includes inertia and extra size for a stretching effect.
|
||||||
-- These settings can be adjusted using the scroll style settings.
|
-- These settings can be adjusted using the scroll style settings.
|
||||||
|
@ -1,9 +1,15 @@
|
|||||||
-- Copyright (c) 2022 Maksim Tuprikov <insality@gmail.com>. This code is licensed under MIT license
|
-- Copyright (c) 2022 Maksim Tuprikov <insality@gmail.com>. This code is licensed under MIT license
|
||||||
|
|
||||||
--- Druid Rich Text custom component.
|
--- Druid Rich Text custom component.
|
||||||
-- # Overview #
|
-- <b># Overview #</b>
|
||||||
--
|
--
|
||||||
-- # Notes #
|
-- Heavily inspired by https://github.com/britzl/defold-richtext.
|
||||||
|
--
|
||||||
|
-- Uses the same syntax for tags, but currently have less tags support.
|
||||||
|
--
|
||||||
|
-- <b># Notes #</b>
|
||||||
|
--
|
||||||
|
-- • Nested tags are supported
|
||||||
--
|
--
|
||||||
-- @usage
|
-- @usage
|
||||||
-- local RichText = require("druid.custom.rich_text.rich_text")
|
-- local RichText = require("druid.custom.rich_text.rich_text")
|
||||||
@ -57,6 +63,49 @@ end
|
|||||||
-- @tparam string text The text to set
|
-- @tparam string text The text to set
|
||||||
-- @treturn table words
|
-- @treturn table words
|
||||||
-- @treturn table line_metrics
|
-- @treturn table line_metrics
|
||||||
|
-- @usage
|
||||||
|
-- • color: Change text color
|
||||||
|
--
|
||||||
|
-- <color=red>Foobar</color>
|
||||||
|
-- <color=1.0,0,0,1.0>Foobar</color>
|
||||||
|
-- <color=#ff0000>Foobar</color>
|
||||||
|
-- <color=#ff0000ff>Foobar</color>
|
||||||
|
--
|
||||||
|
-- • shadow: Change text shadow
|
||||||
|
--
|
||||||
|
-- <shadow=red>Foobar</shadow>
|
||||||
|
-- <shadow=1.0,0,0,1.0>Foobar</shadow>
|
||||||
|
-- <shadow=#ff0000>Foobar</shadow>
|
||||||
|
-- <shadow=#ff0000ff>Foobar</shadow>
|
||||||
|
--
|
||||||
|
-- • outline: Change text shadow
|
||||||
|
--
|
||||||
|
-- <outline=red>Foobar</outline>
|
||||||
|
-- <outline=1.0,0,0,1.0>Foobar</outline>
|
||||||
|
-- <outline=#ff0000>Foobar</outline>
|
||||||
|
-- <outline=#ff0000ff>Foobar</outline>
|
||||||
|
--
|
||||||
|
-- • font: Change font
|
||||||
|
--
|
||||||
|
-- <font=MyCoolFont>Foobar</font>
|
||||||
|
--
|
||||||
|
-- • size: Change text size, relative to default size
|
||||||
|
--
|
||||||
|
-- <size=2>Twice as large</size>
|
||||||
|
--
|
||||||
|
-- • br: Insert a line break
|
||||||
|
--
|
||||||
|
-- <br/>
|
||||||
|
--
|
||||||
|
-- • nobr: Prevent the text from breaking
|
||||||
|
--
|
||||||
|
-- Words <nobr>inside tag</nobr> won't break
|
||||||
|
--
|
||||||
|
-- • img: Display image
|
||||||
|
--
|
||||||
|
-- <img=texture:image/>
|
||||||
|
-- <img=texture:image,size/>
|
||||||
|
-- <img=texture:image,width,height/>
|
||||||
function RichText.set_text(self, text)
|
function RichText.set_text(self, text)
|
||||||
self:clean()
|
self:clean()
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
-- Copyright (c) 2021 Maksim Tuprikov <insality@gmail.com>. This code is licensed under MIT license
|
-- Copyright (c) 2021 Maksim Tuprikov <insality@gmail.com>. This code is licensed under MIT license
|
||||||
|
|
||||||
--- Druid UI Component Framework.
|
--- Druid UI Component Framework.
|
||||||
-- # Overview #
|
-- <b># Overview #</b>
|
||||||
--
|
--
|
||||||
-- Druid - powerful Defold component UI library. Use basic and extended
|
-- Druid - powerful Defold component UI library. Use basic and extended
|
||||||
-- Druid components or make your own game-specific components to make
|
-- 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.
|
-- To start using Druid, please refer to the Basic Usage section below.
|
||||||
--
|
--
|
||||||
-- # Tech Info #
|
-- <b># Notes #</b>
|
||||||
--
|
--
|
||||||
-- • Each Druid instance maintains the self context from the constructor and passes it to each Druid callback.
|
-- • Each Druid instance maintains the self context from the constructor and passes it to each Druid callback.
|
||||||
--
|
--
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
--- Component to wrap over GUI Text nodes with localization helpers
|
--- Component to wrap over GUI Text nodes with localization helpers
|
||||||
--
|
--
|
||||||
-- ## Overview ##
|
-- <b># Overview #</b>
|
||||||
--
|
--
|
||||||
-- • The initialization of druid.set_text_function is required to enable localization
|
-- • The initialization of druid.set_text_function is required to enable localization
|
||||||
-- using the localization ID.
|
-- using the localization ID.
|
||||||
@ -10,7 +10,7 @@
|
|||||||
-- • The LangText component supports up to 7 string format parameters.
|
-- • The LangText component supports up to 7 string format parameters.
|
||||||
-- This limitation exists due to certain issues with using ... arguments.
|
-- This limitation exists due to certain issues with using ... arguments.
|
||||||
--
|
--
|
||||||
-- ## Notes ##
|
-- <b># Notes #</b>
|
||||||
--
|
--
|
||||||
-- @module LangText
|
-- @module LangText
|
||||||
-- @within BaseComponent
|
-- @within BaseComponent
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
-- Copyright (c) 2021 Maksim Tuprikov <insality@gmail.com>. This code is licensed under MIT license
|
-- Copyright (c) 2021 Maksim Tuprikov <insality@gmail.com>. This code is licensed under MIT license
|
||||||
|
|
||||||
--- Druid component to handle the progress bars.
|
--- Druid component to handle the progress bars.
|
||||||
-- # Overview #
|
-- <b># Overview #</b>
|
||||||
--
|
--
|
||||||
-- # Notes #
|
-- <b># Notes #</b>
|
||||||
--
|
--
|
||||||
-- • Progress Node should be fully filled in your GUI scene node. It will be the progress maximum size
|
-- • Progress Node should be fully filled in your GUI scene node. It will be the progress maximum size
|
||||||
--
|
--
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
--
|
--
|
||||||
-- For a list of all available components, please refer to the "See Also" section.
|
-- For a list of all available components, please refer to the "See Also" section.
|
||||||
--
|
--
|
||||||
-- # Notes #
|
-- <b># Notes #</b>
|
||||||
--
|
--
|
||||||
-- Please review the following API pages:
|
-- Please review the following API pages:
|
||||||
--
|
--
|
||||||
|
Loading…
x
Reference in New Issue
Block a user