sonic-bluestreak/sonic-bluestreak.love/birb/modules/gui/elements/variable.lua

14 lines
399 B
Lua
Raw Permalink Normal View History

2021-11-25 10:46:15 +01:00
local Parent = require "birb.modules.gui.elements.text"
local VariableElement = Parent:extend()
function VariableElement:new(name, fontName, object, varName, x, y, align)
VariableElement.super.new(self, name, fontName, "", x, y, align)
self.object = object
self.variable = varName
end
function VariableElement:getText()
return self.object[self.variable]
end
return VariableElement