diff --git a/deployer_build_stats.csv b/deployer_build_stats.csv
index de95ac5..09bbddc 100644
--- a/deployer_build_stats.csv
+++ b/deployer_build_stats.csv
@@ -7,3 +7,5 @@ date,sha,version,build_size,build_time,platform,mode,is_cache_using,commits_coun
2022-03-12T10:01:30Z,d0f3d6641a08b0d6b719b13017aa85907d1667e5,0.8.564,2200,44,js-web,release,true,564
2022-08-29T18:27:58Z,b2643ebd268b15884363efd17724e689279946f1,0.9.589,2316,45,js-web,release,true,589
2022-08-29T18:46:47Z,13003e472169cbd261e703eca7b133adf64a24f7,0.9.592,2316,40,js-web,release,true,592
+2022-09-09T17:55:42Z,072507cc9e715541bdee7636d2e5eeeb3c22a57d,0.10.603,2340,43,js-web,release,true,603
+2022-09-09T18:00:07Z,072507cc9e715541bdee7636d2e5eeeb3c22a57d,0.10.603,2340,5,js-web,release,true,603
diff --git a/docs/druid/archive/archive_files.json b/docs/druid/archive/archive_files.json
index 5138234..28c4c68 100644
--- a/docs/druid/archive/archive_files.json
+++ b/docs/druid/archive/archive_files.json
@@ -1 +1 @@
-{"content":[{"name":"game.projectc","size":3808,"pieces":[{"name":"game.projectc0","offset":0}]},{"name":"game.arci","size":17728,"pieces":[{"name":"game.arci0","offset":0}]},{"name":"game.arcd","size":421233,"pieces":[{"name":"game.arcd0","offset":0}]},{"name":"game.dmanifest","size":18513,"pieces":[{"name":"game.dmanifest0","offset":0}]},{"name":"game.public.der","size":162,"pieces":[{"name":"game.public.der0","offset":0}]}]}
\ No newline at end of file
+{"content":[{"name":"game.projectc","size":3797,"pieces":[{"name":"game.projectc0","offset":0}]},{"name":"game.arci","size":19808,"pieces":[{"name":"game.arci0","offset":0}]},{"name":"game.arcd","size":449757,"pieces":[{"name":"game.arcd0","offset":0}]},{"name":"game.dmanifest","size":20704,"pieces":[{"name":"game.dmanifest0","offset":0}]},{"name":"game.public.der","size":162,"pieces":[{"name":"game.public.der0","offset":0}]}]}
\ No newline at end of file
diff --git a/docs/druid/archive/game.arcd0 b/docs/druid/archive/game.arcd0
index 39b87ed..3e66d76 100644
Binary files a/docs/druid/archive/game.arcd0 and b/docs/druid/archive/game.arcd0 differ
diff --git a/docs/druid/archive/game.arci0 b/docs/druid/archive/game.arci0
index 4865b5c..6bfe0df 100644
Binary files a/docs/druid/archive/game.arci0 and b/docs/druid/archive/game.arci0 differ
diff --git a/docs/druid/archive/game.dmanifest0 b/docs/druid/archive/game.dmanifest0
index 04fba65..05763cb 100644
Binary files a/docs/druid/archive/game.dmanifest0 and b/docs/druid/archive/game.dmanifest0 differ
diff --git a/docs/druid/archive/game.projectc0 b/docs/druid/archive/game.projectc0
index 8f2cc9f..4c25f8e 100644
--- a/docs/druid/archive/game.projectc0
+++ b/docs/druid/archive/game.projectc0
@@ -1,12 +1,12 @@
[project]
title = druid
-version = 0.9.592
+version = 0.10.603
write_log = 0
compress_archive = 1
publisher = Insality
developer = Insality
-commit_sha = 13003e472169cbd261e703eca7b133adf64a24f7
-build_date = 2022-08-29T18:46:47Z
+commit_sha = 072507cc9e715541bdee7636d2e5eeeb3c22a57d
+build_date = 2022-09-09T18:00:07Z
title_as_file_name = druid
[display]
@@ -120,7 +120,7 @@ default_language = en
localizations = en
[android]
-version_code = 592
+version_code = 603
minimum_sdk_version = 16
target_sdk_version = 30
package = com.insality.druid
@@ -144,7 +144,7 @@ localizations = en
custom_heap_size = 0
heap_size = 64
htmlfile = /builtins/manifests/web/engine_template.html
-cssfile = /builtins/manifests/web/light_theme.css
+cssfile = /example/light_theme.css
archive_location_prefix = archive
show_fullscreen_button = 0
show_made_with_defold = 0
@@ -192,7 +192,7 @@ run_while_iconified = 0
[druid]
no_auto_input = 0
-stencil_check = 0
+no_stencil_check = 0
no_auto_template = 0
input_text = text
input_touch = touch
diff --git a/docs/druid/index.html b/docs/druid/index.html
index 7531689..b2ac38d 100644
--- a/docs/druid/index.html
+++ b/docs/druid/index.html
@@ -7,7 +7,7 @@
-
druid 0.9.592
+ druid 0.10.603
diff --git a/docs/modules/DruidInstance.html b/docs/modules/DruidInstance.html
index 8423387..6cfea85 100644
--- a/docs/modules/DruidInstance.html
+++ b/docs/modules/DruidInstance.html
@@ -114,6 +114,10 @@
Call on final function on gui_script. |
+ late_init(self) |
+ Druid late update function call after init and before udpate step |
+
+
log_message(self, message[, context]) |
Log message, if is_debug mode is enabled |
@@ -268,6 +272,27 @@
+
+
+
+ late_init(self)
+
+
+ Druid late update function call after init and before udpate step
+
+
+ Parameters:
+
+ - self
+ DruidInstance
+
+
+
+
+
+
+
+
diff --git a/docs/modules/Layout.html b/docs/modules/Layout.html
index fa51dd2..cb33308 100644
--- a/docs/modules/Layout.html
+++ b/docs/modules/Layout.html
@@ -30,6 +30,11 @@
Index
+Contents
+
Modules
@@ -73,11 +78,377 @@
+
+
+
+
+
+ mode |
+ Current layout mode |
+
+
+ node |
+ Layout node |
+
+
+ on_size_changed |
+ On window resize callback(self, new_size) |
+
+
+
+
+
+ -
+
+ fit_into_node(self[, node])
+
+ -
+ Set node for layout node to fit inside it. Pass nil to reset
+
+
+
Parameters:
+
+ - self
+ Layout
+ Layout
+
+ - node
+ Node
+
+ (optional)
+
+
+
+ Returns:
+
+
+ Layout
+ Layout
+
+
+
+
+
+
+ -
+
+ fit_into_size(self, target_size)
+
+ -
+ Set size for layout node to fit inside it
+
+
+
Parameters:
+
+ - self
+ Layout
+ Layout
+
+ - target_size
+ vector3
+
+
+
+
+ Returns:
+
+
+ Layout
+ Layout
+
+
+
+
+
+
+ -
+
+ fit_into_window(self)
+
+ -
+ Set current size for layout node to fit inside it
+
+
+
Parameters:
+
+
+ Returns:
+
+
+ Layout
+ Layout
+
+
+
+
+
+
+ -
+
+ init(self, node, mode[, on_size_changed_callback])
+
+ -
+ Component init function
+
+
+
Parameters:
+
+ - self
+ Layout
+ Layout
+
+ - node
+ node
+ Gui node
+
+ - mode
+ string
+ The layout mode (from const.LAYOUT_MODE)
+
+ - on_size_changed_callback
+ function
+ The callback on window resize
+ (optional)
+
+
+
+
+
+
+
+
+ -
+
+ set_max_size(self, max_size)
+
+ -
+ Set maximum size of layout node
+
+
+
Parameters:
+
+ - self
+ Layout
+ Layout
+
+ - max_size
+ vector3
+
+
+
+
+ Returns:
+
+
+ Layout
+ Layout
+
+
+
+
+
+
+ -
+
+ set_min_size(self, min_size)
+
+ -
+ Set minimal size of layout node
+
+
+
Parameters:
+
+ - self
+ Layout
+ Layout
+
+ - min_size
+ vector3
+
+
+
+
+ Returns:
+
+
+ Layout
+ Layout
+
+
+
+
+
+
+ -
+
+ set_origin_position(self, new_origin_position)
+
+ -
+ Set new origin position of layout node. You should apply this on node movement
+
+
+
Parameters:
+
+ - self
+ Layout
+ Layout
+
+ - new_origin_position
+ vector3
+
+
+
+
+ Returns:
+
+
+ Layout
+ Layout
+
+
+
+
+
+
+ -
+
+ set_origin_size(self, new_origin_size)
+
+ -
+ Set new origin size of layout node. You should apply this on node manual size change
+
+
+
Parameters:
+
+ - self
+ Layout
+ Layout
+
+ - new_origin_size
+ vector3
+
+
+
+
+ Returns:
+
+
+ Layout
+ Layout
+
+
+
+
+
+
+
+
+
+
+ -
+
+ mode
+
+ -
+ Current layout mode
+
+
+
+
+
+
+
+
+
+ -
+
+ node
+
+ -
+ Layout node
+
+
+
+
+
+
+
+
+
+ -
+
+ on_size_changed
+
+ -
+ On window resize callback(self, new_size)
+
+
+
+
+
+
+
+
+
+
diff --git a/docs_md/changelog.md b/docs_md/changelog.md
index d14ca49..a442d6b 100644
--- a/docs_md/changelog.md
+++ b/docs_md/changelog.md
@@ -395,7 +395,7 @@ Take care of yourself
### Druid 0.10.0
-Hello! Here is new Druid small update. It's brings to you two new components: Layout and Hotkey. Both components are "extended", so to use it, you should register it first (when you try to use it, in console will be prompt with code you should use)
+Hello! Here is new Druid update. It's brings to you two new components: Layout and Hotkey. Both components are "extended", so to use it, you should register it first (when you try to use it, in console will be prompt with code you should use)
In general:
```
@@ -403,9 +403,13 @@ local layout = require("druid.extended.layout")
druid.register("layout", layout)
```
-The drag component now knows about window scaling, so now it have more accuracy dx/dy values depends on the screen size. The scroll and other components should work better :)
+The Drag component now knows about window scaling, so now it have more accuracy dx/dy values depends on the screen size. The scroll and other components should work better :)
-Also now you can change the input priority of components temporary. For example while you interact with them (input fields, drag on select etc).
+Now you can change the input priority of components temporary. For example while you interact with them (input fields, drag on select etc).
+
+Also the update brings several bug fixes and now **Druid** have stencil_check mode enabled by default. It should be more easy to use input components with stencil nodes without manual `set_click_zone` functions.
+
+And yeah, the new **Druid** logo is here!
**Changelog 0.10.0**
@@ -414,7 +418,7 @@ Also now you can change the input priority of components temporary. For example
- **#133** [Hotkey] Add new extended component: Hotkey
- It's allow you set hotkeys to call callbacks
- You should pass one action key and several modificator keys (left shift, right ctrl etc)
- - List of modificator keys setup via component style (you can change it)
+ - List of modificator keys ids setup via component style (you can change it)
- You can add several hotkeys on one callback via `hotkey:add_hotkey` with additional params
- **#98** [Layout] Add new extended component: Layout
- It's allow you to extend standart Defold node adjust modes
@@ -436,8 +440,9 @@ Also now you can change the input priority of components temporary. For example
- **#190** [Progress] Add `progress:set_max_size` function to change max size of progress bar
- **#188** [Drag] Add two values passed to on_drag callback. Now it is `on_drag(self, dx, dy, total_x, total_y)` to check the overral drag distance
- **#195** [Drag] Add `drag:is_enabled` and `drag:set_enabled` to enable/disable drag input component
-- **#186** [Grid] Fix: Method set_in_row works incorrectly with IS_DYNAMIC_NODE_POSES style option
+- **#186** [Grid] Fix: Method `set_in_row` works incorrectly with IS_DYNAMIC_NODE_POSES style option
- **#185** [System] Add `on_window_resized` component interest. It will called on game window size changes
- **#189** [System] Add optional flag to `component:set_input_priority` to mark it as temporary. It will reset to default input priority after the `component:reset_input_priority`
- **#204** [System] Fix: wrong code example link, if open example from direct URL
-- **#202** [System] Enabled stencil check to true by default. To disable this, use druid.no_stencil_check in game.project settings
+- **#202** [System] Enabled stencil check to true by default. To disable this, use `druid.no_stencil_check` in game.project settings
+- [Examples] Add layout, layout fit, progres bar, data list + component examples
diff --git a/druid/annotations.lua b/druid/annotations.lua
index 30a751a..7d33117 100644
--- a/druid/annotations.lua
+++ b/druid/annotations.lua
@@ -763,6 +763,64 @@ function druid__lang_text.set_to(self, text) end
function druid__lang_text.translate(self, locale_id, a, b, c, d, e, f, g) end
+---@class druid.layout : druid.base_component
+---@field mode string Current layout mode
+---@field node node Layout node
+---@field on_size_changed druid.event On window resize callback(self, new_size)
+local druid__layout = {}
+
+--- Set node for layout node to fit inside it.
+--- Pass nil to reset
+---@param self druid.layout @{Layout}
+---@param node Node
+---@return druid.layout @{Layout}
+function druid__layout.fit_into_node(self, node) end
+
+--- Set size for layout node to fit inside it
+---@param self druid.layout @{Layout}
+---@param target_size vector3
+---@return druid.layout @{Layout}
+function druid__layout.fit_into_size(self, target_size) end
+
+--- Set current size for layout node to fit inside it
+---@param self druid.layout @{Layout}
+---@return druid.layout @{Layout}
+function druid__layout.fit_into_window(self) end
+
+--- Component init function
+---@param self druid.layout @{Layout}
+---@param node node Gui node
+---@param mode string The layout mode (from const.LAYOUT_MODE)
+---@param on_size_changed_callback function The callback on window resize
+function druid__layout.init(self, node, mode, on_size_changed_callback) end
+
+--- Set maximum size of layout node
+---@param self druid.layout @{Layout}
+---@param max_size vector3
+---@return druid.layout @{Layout}
+function druid__layout.set_max_size(self, max_size) end
+
+--- Set minimal size of layout node
+---@param self druid.layout @{Layout}
+---@param min_size vector3
+---@return druid.layout @{Layout}
+function druid__layout.set_min_size(self, min_size) end
+
+--- Set new origin position of layout node.
+--- You should apply this on node movement
+---@param self druid.layout @{Layout}
+---@param new_origin_position vector3
+---@return druid.layout @{Layout}
+function druid__layout.set_origin_position(self, new_origin_position) end
+
+--- Set new origin size of layout node.
+--- You should apply this on node manual size change
+---@param self druid.layout @{Layout}
+---@param new_origin_size vector3
+---@return druid.layout @{Layout}
+function druid__layout.set_origin_size(self, new_origin_size) end
+
+
---@class druid.pin_knob : druid.base_component
---@field druid druid_instance The component druid instance
---@field is_drag bool Is currently under user control
@@ -1347,6 +1405,10 @@ local druid_instance = {}
---@param self druid_instance
function druid_instance.final(self) end
+--- Druid late update function call after init and before udpate step
+---@param self druid_instance
+function druid_instance.late_init(self) end
+
--- Log message, if is_debug mode is enabled
---@param self druid_instance @{DruidInstance}
---@param message string
diff --git a/druid/extended/layout.lua b/druid/extended/layout.lua
index f2cfd75..0c544f5 100644
--- a/druid/extended/layout.lua
+++ b/druid/extended/layout.lua
@@ -29,7 +29,7 @@ local Layout = component.create("layout")
--- Component init function
-- @tparam Layout self @{Layout}
-- @tparam node node Gui node
--- @tparam string node The layout mode (from const.LAYOUT_MODE)
+-- @tparam string mode The layout mode (from const.LAYOUT_MODE)
-- @tparam[opt] function on_size_changed_callback The callback on window resize
function Layout.init(self, node, mode, on_size_changed_callback)
self.node = self:get_node(node)
@@ -122,7 +122,7 @@ end
--- Set maximum size of layout node
-- @tparam Layout self @{Layout}
--- @tparam vector3 min_size
+-- @tparam vector3 max_size
-- @treturn Layout @{Layout}
function Layout.set_max_size(self, max_size)
self._max_size = max_size
diff --git a/game.project b/game.project
index 2ae077f..d5aaf3a 100644
--- a/game.project
+++ b/game.project
@@ -12,7 +12,7 @@ dynamic_orientation = 1
[project]
title = druid
-version = 0.9.0
+version = 0.10.0
publisher = Insality
developer = Insality
dependencies#0 = https://github.com/insalitygames/deftest/archive/master.zip