From 9bf4d32d40e9131ec4daebe7ae315025166ecd65 Mon Sep 17 00:00:00 2001 From: Insality Date: Sat, 27 Sep 2025 12:49:43 +0300 Subject: [PATCH] Update --- druid/color.lua | 2 +- druid/custom/rich_text/rich_text.lua | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/druid/color.lua b/druid/color.lua index f7567a2..38a1537 100644 --- a/druid/color.lua +++ b/druid/color.lua @@ -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 diff --git a/druid/custom/rich_text/rich_text.lua b/druid/custom/rich_text/rich_text.lua index 5ae422f..7209263 100644 --- a/druid/custom/rich_text/rich_text.lua +++ b/druid/custom/rich_text/rich_text.lua @@ -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