2021-08-30 14:11:08 +02:00
|
|
|
local Parent = require "birb.modules.gui.elements.text"
|
|
|
|
local VariableElement = Parent:extend()
|
|
|
|
|
2021-08-31 10:56:43 +02:00
|
|
|
function VariableElement:new(name, fontName, object, varName, x, y, align)
|
|
|
|
VariableElement.super.new(self, name, fontName, "", x, y, align)
|
2021-08-30 14:11:08 +02:00
|
|
|
self.object = object
|
|
|
|
self.variable = varName
|
|
|
|
end
|
|
|
|
|
|
|
|
function VariableElement:getText()
|
|
|
|
return self.object[self.variable]
|
|
|
|
end
|
|
|
|
|
|
|
|
return VariableElement
|