mirror of
https://github.com/Insality/druid
synced 2025-06-27 10:27:48 +02:00
WIP
This commit is contained in:
parent
5d5fe7f374
commit
a4fa0f0348
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user