This commit is contained in:
Insality 2024-10-14 22:24:57 +03:00
parent 5d5fe7f374
commit a4fa0f0348
2 changed files with 3 additions and 9 deletions

View File

@ -154,7 +154,6 @@ function M.create(text, settings, style)
-- default settings for a word
-- will be assigned to each word unless tags override the values
local font = gui.get_font(settings.text_prefab)
local word_params = {
node = nil, -- Autofill on node creation
relative_scale = 1,
@ -171,7 +170,7 @@ function M.create(text, settings, style)
text_color = gui.get_color(settings.text_prefab),
shadow = settings.shadow,
outline = settings.outline,
font = font,
font = gui.get_font(settings.text_prefab),
-- Image params
---@type druid.rich_text.image
image = nil,
@ -409,8 +408,8 @@ function M._update_nodes(lines, settings)
if word.image then
node = word.node or gui.new_box_node(vmath.vector3(0), word.size)
gui.set_size_mode(node, gui.SIZE_MODE_MANUAL)
gui.set_texture(node, word.image.texture or settings.default_texture)
gui.play_flipbook(node, hash(word.image.anim or settings.default_animation))
gui.set_texture(node, word.image.texture)
gui.play_flipbook(node, hash(word.image.anim))
gui.set_color(node, word.color or word.image_color)
else
node = word.node or gui.clone(settings.text_prefab)

View File

@ -127,8 +127,6 @@ end
function RichText.on_layout_change(self)
gui.set_enabled(self.text_prefab, false)
gui.set_enabled(self.icon_prefab, false)
if self._last_value then
self:set_text(self._last_value)
end
@ -294,9 +292,6 @@ function RichText:_create_settings()
-- Image settings
image_pixel_grid_snap = false, -- disabled now
node_scale = gui.get_scale(self.text_prefab),
image_scale = gui.get_scale(self.text_prefab),
--default_animation = gui.get_flipbook(self.icon_prefab),
--default_texture = gui.get_texture(self.icon_prefab),
}
end