mirror of
https://github.com/Insality/druid
synced 2025-06-27 02:17:52 +02:00
Update
This commit is contained in:
parent
330dabda09
commit
fb9c80b284
@ -245,6 +245,7 @@ Or refer directly to the [**example folder**](https://github.com/Insality/druid/
|
||||
You can find the full **Druid** functions at [Quick API Reference](api/quick_api_reference.md)
|
||||
|
||||
To better understand **Druid**, read the following documentation:
|
||||
|
||||
- [How To GUI in Defold](https://forum.defold.com/t/how-to-gui-in-defold/73256)
|
||||
- [Widgets](wiki/widgets.md)
|
||||
- [Create custom components](docs_md/02-creating_custom_components.md)
|
||||
|
@ -1,31 +0,0 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "."
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"files.exclude": {
|
||||
"**/.git": true, // this is a default value
|
||||
"**/.DS_Store": true, // this is a default value
|
||||
|
||||
"**/node_modules": true, // this excludes all folders
|
||||
// named "node_modules" from
|
||||
// the explore tree
|
||||
|
||||
// alternative version
|
||||
"node_modules": true, // this excludes the folder
|
||||
// only from the root of
|
||||
// your workspace
|
||||
".internal": true,
|
||||
"bundle": true,
|
||||
"input": true,
|
||||
"media": true,
|
||||
"build": true,
|
||||
"docs": true,
|
||||
".github": true,
|
||||
".deployer_cache": true,
|
||||
"dist": true
|
||||
}
|
||||
}
|
||||
}
|
@ -66,7 +66,6 @@ local M = component.create("scroll")
|
||||
---The Scroll constructor
|
||||
---@param view_node string|node GUI view scroll node - the static part that captures user input
|
||||
---@param content_node string|node GUI content scroll node - the dynamic part that will change position
|
||||
---@return druid.scroll
|
||||
function M:init(view_node, content_node)
|
||||
self.druid = self:get_druid()
|
||||
|
||||
@ -774,6 +773,9 @@ end
|
||||
---Update vector with next conditions:
|
||||
---Field x have to <= field z
|
||||
---Field y have to <= field w
|
||||
---@param vector vector4
|
||||
---@param offset vector3
|
||||
---@return vector4
|
||||
function M:_get_border_vector(vector, offset)
|
||||
if vector.x > vector.z then
|
||||
vector.x, vector.z = vector.z, vector.x
|
||||
|
@ -1,4 +1,3 @@
|
||||
local const = require("druid.const")
|
||||
local settings = require("druid.system.settings")
|
||||
|
||||
local M = {}
|
||||
|
@ -175,17 +175,17 @@ end
|
||||
|
||||
---@param scale number
|
||||
function M:set_scale(scale)
|
||||
local current_scale_x = gui.get(self.node, helper.PROP_SCALE_X)
|
||||
local current_scale_y = gui.get(self.node, helper.PROP_SCALE_Y)
|
||||
local current_size_x = gui.get(self.node, helper.PROP_SIZE_X)
|
||||
local current_size_y = gui.get(self.node, helper.PROP_SIZE_Y)
|
||||
local current_scale_x = gui.get(self.node, M.PROP_SCALE_X)
|
||||
local current_scale_y = gui.get(self.node, M.PROP_SCALE_Y)
|
||||
local current_size_x = gui.get(self.node, M.PROP_SIZE_X)
|
||||
local current_size_y = gui.get(self.node, M.PROP_SIZE_Y)
|
||||
|
||||
local delta_scale_x = scale / current_scale_x
|
||||
local delta_scale_y = scale / current_scale_y
|
||||
gui.set(self.node, helper.PROP_SCALE_X, scale)
|
||||
gui.set(self.node, helper.PROP_SCALE_Y, scale)
|
||||
gui.set(self.node, helper.PROP_SIZE_X, current_size_x / delta_scale_x)
|
||||
gui.set(self.node, helper.PROP_SIZE_Y, current_size_y / delta_scale_y)
|
||||
gui.set(self.node, M.PROP_SCALE_X, scale)
|
||||
gui.set(self.node, M.PROP_SCALE_Y, scale)
|
||||
gui.set(self.node, M.PROP_SIZE_X, current_size_x / delta_scale_x)
|
||||
gui.set(self.node, M.PROP_SIZE_Y, current_size_y / delta_scale_y)
|
||||
|
||||
return self
|
||||
end
|
||||
|
@ -8,10 +8,10 @@ local M = {}
|
||||
function M:init()
|
||||
self.root = self:get_node("root")
|
||||
self.text_name = self.druid:new_text("text_name")
|
||||
:set_text_adjust("scale_when_trim_left", 0.3)
|
||||
:set_text_adjust("scale_then_trim_left", 0.3)
|
||||
|
||||
self.text_right = self.druid:new_text("text_right", "")
|
||||
--:set_text_adjust("scale_when_trim_left", 0.3) -- TODO: not works? why?
|
||||
--:set_text_adjust("scale_then_trim_left", 0.3) -- TODO: not works? why?
|
||||
|
||||
self.container = self.druid:new_container(self.root)
|
||||
self.container:add_container("text_name", nil, function(_, size)
|
||||
|
@ -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
|
||||
|
@ -1,4 +0,0 @@
|
||||
[liveupdate]
|
||||
mode = Zip
|
||||
supported-versions =
|
||||
|
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user