mirror of
https://github.com/Insality/druid
synced 2025-09-27 18:12:21 +02:00
Update example with new brand one
This commit is contained in:
18
example/examples/basic/rich_text/basic_rich_text.lua
Normal file
18
example/examples/basic/rich_text/basic_rich_text.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
local component = require("druid.component")
|
||||
local rich_text = require("druid.custom.rich_text.rich_text")
|
||||
|
||||
---@class basic_rich_text: druid.base_component
|
||||
---@field druid druid_instance
|
||||
---@field rich_text druid.rich_text
|
||||
local M = component.create("basic_rich_text")
|
||||
|
||||
|
||||
---@param template string
|
||||
---@param nodes table<hash, node>
|
||||
function M:init(template, nodes)
|
||||
self.druid = self:get_druid(template, nodes)
|
||||
self.druid:new(rich_text, "text", "Hello, I'm a <font=text_bold><color=E48155>Rich Text</font></color>!")
|
||||
end
|
||||
|
||||
|
||||
return M
|
Reference in New Issue
Block a user