Update docs, config generations, fix linter

This commit is contained in:
Insality
2024-10-15 19:34:07 +03:00
parent 2f5336fa4f
commit 5848921cba
44 changed files with 1880 additions and 1336 deletions

View File

@@ -227,7 +227,7 @@ function M._fill_properties(word, metrics, settings)
else
-- Text properties
word.scale = settings.scale * word.relative_scale * settings.adjust_scale
word.pivot = gui.PIVOT_W -- With this pivot adjustments works correctly, but with another some misalignment
word.pivot = gui.PIVOT_SW -- With this pivot adjustments works more correctly than with other pivots
word.size = vmath.vector3(metrics.width, metrics.height, 0)
word.offset = vmath.vector3(metrics.offset_x, metrics.offset_y, 0)
end

View File

@@ -1,45 +0,0 @@
fonts {
name: "game"
font: "/example/assets/fonts/game.font"
}
textures {
name: "items"
texture: "/example/assets/images/kenney.atlas"
}
nodes {
size {
x: 400.0
y: 100.0
}
type: TYPE_BOX
id: "root"
inherit_alpha: true
visible: false
}
nodes {
position {
x: -200.0
}
size {
x: 400.0
y: 100.0
}
type: TYPE_TEXT
text: "Rich text"
font: "game"
id: "text_prefab"
pivot: PIVOT_W
parent: "root"
inherit_alpha: true
outline_alpha: 0.0
shadow_alpha: 0.0
}
nodes {
type: TYPE_BOX
id: "icon_prefab"
parent: "root"
inherit_alpha: true
size_mode: SIZE_MODE_AUTO
}
material: "/builtins/materials/gui.material"
adjust_reference: ADJUST_REFERENCE_PARENT

View File

@@ -109,8 +109,8 @@ local RichText = component.create("rich_text")
--- The @{RichText} constructor
-- @tparam RichText self @{RichText}
-- @tparam string template The Rich Text template name
-- @tparam table nodes The node table, if prefab was copied by gui.clone_tree()
-- @tparam node|string text_node The text node to make Rich Text
-- @tparam string|nil value The initial text value. Default will be gui.get_text(text_node)
function RichText.init(self, text_node, value)
self.root = self:get_node(text_node)
self.text_prefab = self.root