From ec39242fb1878acb1944e9772ffc442ddd911bb8 Mon Sep 17 00:00:00 2001 From: Insality Date: Fri, 25 Apr 2025 20:53:58 +0300 Subject: [PATCH] Update docs --- druid/extended/container.lua | 1 + example/druid.gui | 7 ------- .../container/container_resize/container_resize.gui | 4 ++++ example/examples/using_widgets/using_widgets.gui_script | 1 - game.project | 2 +- wiki/advanced-setup.md | 8 ++++++-- wiki/changelog.md | 9 ++++----- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/druid/extended/container.lua b/druid/extended/container.lua index 43343ca..9e320b7 100644 --- a/druid/extended/container.lua +++ b/druid/extended/container.lua @@ -1,4 +1,5 @@ ---Container component +---Experimental, not tested well, main idea is working -- Container setup in GUI -- parent container - container that contains this container. If not, then it's a window default container or parent node -- container pivot - the point of the parent container that will be used as a pivot point for positioning diff --git a/example/druid.gui b/example/druid.gui index c32bc39..35f0c2c 100644 --- a/example/druid.gui +++ b/example/druid.gui @@ -4998,13 +4998,6 @@ nodes { parent: "container_resize/panel_content" template_node_child: true } -nodes { - type: TYPE_TEMPLATE - id: "use_widgets" - parent: "container" - inherit_alpha: true - template: "/example/examples/container/use_widgets/use_widgets.gui" -} nodes { position { x: -20.0 diff --git a/example/examples/container/container_resize/container_resize.gui b/example/examples/container/container_resize/container_resize.gui index e412365..76f8414 100644 --- a/example/examples/container/container_resize/container_resize.gui +++ b/example/examples/container/container_resize/container_resize.gui @@ -95,6 +95,7 @@ nodes { z: 16.0 w: 16.0 } + alpha: 0.75 } nodes { position { @@ -121,6 +122,7 @@ nodes { z: 16.0 w: 16.0 } + alpha: 0.75 } nodes { position { @@ -149,6 +151,7 @@ nodes { z: 16.0 w: 16.0 } + alpha: 0.75 } nodes { position { @@ -177,6 +180,7 @@ nodes { z: 16.0 w: 16.0 } + alpha: 0.75 } nodes { position { diff --git a/example/examples/using_widgets/using_widgets.gui_script b/example/examples/using_widgets/using_widgets.gui_script index 68b9680..04961aa 100644 --- a/example/examples/using_widgets/using_widgets.gui_script +++ b/example/examples/using_widgets/using_widgets.gui_script @@ -4,7 +4,6 @@ local memory_panel = require("druid.widget.memory_panel.memory_panel") function init(self) self.druid = druid.new(self) - self.memory_panel = self.druid:new_widget(memory_panel, "memory_panel") end diff --git a/game.project b/game.project index 00a11f4..c194066 100644 --- a/game.project +++ b/game.project @@ -58,7 +58,7 @@ cssfile = /builtins/manifests/web/dark_theme.css show_console_banner = 0 [native_extension] -app_manifest = +app_manifest = [graphics] texture_profiles = /builtins/graphics/default.texture_profiles diff --git a/wiki/advanced-setup.md b/wiki/advanced-setup.md index abc6914..98828fb 100644 --- a/wiki/advanced-setup.md +++ b/wiki/advanced-setup.md @@ -79,11 +79,15 @@ end) You can set the text function to get the localized string by locale ID. ```lua +local lang = require("lang.lang") local druid = require("druid.druid") --- The callback should return the localized string by locale ID: function(locale_id) ... end +-- You can use lang.txp function to get the localized string by locale ID +druid.set_text_function(lang.txp) + +-- or custom function with your own logic druid.set_text_function(function(locale_id) - -- return lang.get(locale_id) + return my_lang_table[locale_id] or locale_id end) ``` diff --git a/wiki/changelog.md b/wiki/changelog.md index 903f264..6e2cdfd 100644 --- a/wiki/changelog.md +++ b/wiki/changelog.md @@ -617,7 +617,6 @@ To create a widget with a even more fast way, now you always can right click on - Call `self.widget = self.druid:new_widget(widget_file, "template_id")` to init widget - or Call `self.widget = self.druid:new_widget(widget_file, "template_id", "tempalate_id/root")` to clone root node from template and init widget from it - - **Completely reworked documentation** with full code annotations. Let's check the new brand [Quick API Reference](/api/quick_api_reference.md) to get familiar with **Druid**. Any documentation are generated from the code annotations, so in case to update documentation, you need to update annotations in the code directly. ## Breaking Changes @@ -628,7 +627,7 @@ To create a widget with a even more fast way, now you always can right click on This release represents a major step forward in making Druid more maintainable, readable, and powerful. Check out the full changelog for all the details! -The [contributing guide](CONTRIBUTING.md) is created for people who want to contribute to the Druid. +The [contributing guide](https://github.com/Insality/druid/blob/develop/CONTRIBUTING.md) is created for people who want to contribute to the Druid. Thank you for using Druid and please share your feedback! @@ -640,7 +639,7 @@ Thank you for using Druid and please share your feedback! - The code now is fully annotated - The old API website is removed - The API now placed as a markdown files in the `api` folder of the repository - - Start with [Quick API Reference](/api/quick_api_reference.md) to learn how to use Druid + - Start with [Quick API Reference](https://github.com/Insality/druid/blob/develop/api/quick_api_reference.md) to learn how to use Druid - **[BREAKING]** Remove `druid.event`, replaced with `defold-event` library. Now it required to two dependencies to use Druid. - This allow to make more flexible features, like shaders and sync init functions between script and gui_script in various cases. - You need to migrate from `require("druid.event")` to `require("event.event")` if you are using it in your project @@ -667,12 +666,12 @@ Thank you for using Druid and please share your feedback! - **[System]** 🎉 No need for the `druid.register()`! Now all Druid's components are available by default and available with `self.druid:new_*` functions - This means the Druid will be bigger in size, but it's much comfortable to use - In case you want to delete components you are not using, you can do it in fork in `druid.lua` file - - Read [optimize_druid_size.md](optimize_druid_size.md) to learn how to reduce the size of the Druid library if you interested + - Read [optimize_druid_size.md](https://github.com/Insality/druid/blob/develop/wiki/optimize_druid_size.md) to learn how to reduce the size of the Druid library if you interested - Any additional new widgets, utilities files will be not included until you use it - You still can register your custom components to make a aliases for them. Widgets are not supported here. - **[BREAKING]** Removed old `druid.no_stencil_check` and `druid.no_auto_template` flags. Now it's always disabled - **[System]** Huge code refactoring and improvements. The goal is to raise maintainability and readability of the code to help people to contribute. -- **[Docs]** Add [CONTRIBUTING.md](/CONTRIBUTING.md) file with various information to help people to contribute to the Druid. +- **[Docs]** Add [CONTRIBUTING.md](https://github.com/Insality/druid/blob/develop/CONTRIBUTING.md) file with various information to help people to contribute to the Druid. - **[Editor Scripts]** Updated editor scripts - **[Editor Scripts]** Add "[Druid] Create Druid Widget" instead of "Create Custom Component" - **[Editor Scripts]** Add "[Druid] Settings" editor dialog