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

13 lines
436 B
Lua
Raw Permalink Normal View History

2021-11-25 10:46:15 +01:00
local Parent = require "birb.modules.gui.elements.variable"
local CounterElement = Parent:extend()
function CounterElement:new(name, fontName, object, varName, nbrs, x, y, align)
CounterElement.super.new(self, name, fontName, object, varName, x, y, align)
self.nbrs = nbrs or 0
end
function CounterElement:getText()
return utils.math.numberToString(CounterElement.super.getText(self), self.nbrs)
end
return CounterElement