sonic-radiance/sonic-radiance.love/birb/modules/gui/elements/variable.lua
2021-08-30 14:11:08 +02:00

14 lines
No EOL
413 B
Lua

local Parent = require "birb.modules.gui.elements.text"
local VariableElement = Parent:extend()
function VariableElement:new(name, fontName, object, varName, x, y, align, depth)
VariableElement.super.new(self, name, fontName, "", x, y, align, depth)
self.object = object
self.variable = varName
end
function VariableElement:getText()
return self.object[self.variable]
end
return VariableElement