An API to add arguments that every effect in the text object can access.
local sword = {
damage = 12,
cooldown = 2,
}
-- We can make effects to have some nice formatting
RichText.addInsertionEffect("damage", function(text, str, args)
return "{color r=0.5 g=0, b=0}" .. text.args.sword.damage .. "{/color}"
end)
-- Then, apply like:
local format = [[
My weapon does {damage/} damage!
]]
local text = RichText.new(font, format, {sword=sword})
-- (would need formatting support)
An API to add arguments that every effect in the text object can access.