2022-08-12 10:50:42 +02:00
|
|
|
local Parent = require "framework.modules.gui.elements.text"
|
2021-12-04 13:18:54 +01:00
|
|
|
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
|