You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
590 B

UIProgressBar = extends(UIWidget)
function UIProgressBar.create()
local progressbar = UIProgressBar.internalCreate()
progressbar:setFocusable(false)
progressbar:setPhantom(true)
progressbar.percent = 0
progressbar:setBackgroundSize({width = 1, height = 1})
return progressbar
end
function UIProgressBar:setPercent(percent)
self:setBackgroundHeight(self:getHeight())
local width = (percent * self:getWidth())/100
if width == 0 then width = 1 end
self:setBackgroundWidth(width)
self.percent = percent
end
function UIProgressBar:getPercent()
return self.percent
end