This commit is contained in:
Insality
2025-09-27 12:49:43 +03:00
parent 9ee084c502
commit 9bf4d32d40
2 changed files with 17 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ local COLOR_WHITE = vmath.vector4(1, 1, 1, 1)
local COLOR_X = hash("color.x")
local COLOR_Y = hash("color.y")
local COLOR_Z = hash("color.z")
local ALPHA = hash("color.w")
local M = {}
@@ -83,7 +84,6 @@ function M.lerp(t, color1, color2)
end
---Convert hex color to rgb values.
---@param hex string Hex color. #00BBAA or 00BBAA or #0BA or 0BA
---@return number, number, number

View File

@@ -34,7 +34,7 @@ local rich_text = require("druid.custom.rich_text.module.rt")
---@field scale vector3
---@field size vector3
---@field metrics druid.rich_text.metrics
---@field pivot userdata
---@field pivot constant
---@field text string
---@field shadow vector4
---@field outline vector4
@@ -68,7 +68,7 @@ local rich_text = require("druid.custom.rich_text.module.rt")
---The component that handles a rich text display, allows to custom color, size, font, etc. of the parts of the text
---@class druid.rich_text: druid.component
---@field root node The root node of the rich text
---@field root node The root text node of the rich text
---@field text_prefab node The text prefab node
---@field private _last_value string The last value of the rich text
---@field private _settings table The settings of the rich text
@@ -255,4 +255,18 @@ function M:_create_settings()
end
---Set the width of the rich text, not affects the size of current spawned words
---@param width number
function M:set_width(width)
self._settings.width = width
end
---Set the height of the rich text, not affects the size of current spawned words
---@param height number
function M:set_height(height)
self._settings.height = height
end
return M