--OSProgressBar-- __index = OSControl type = "OSProgressBar" value = 0 BackgroundColour = colours.white ProgressBackgroundColour = colours.lightBlue new = function(self, _x, _y, _width, _value) local new = {} -- the new instance setmetatable( new, {__index = OSProgressBar} ) -- copy an instance of OSMenuItem new.width = _width new.height = 1 new.x = _x new.y = _y new.value = _value return new end Draw = function(self) if self.value > 100 then self.value = 0 end --prevent value from going above 100 percent local progressEnd = OSServices.round(((self.value)/100)*self.width) OSDrawing.DrawBlankArea(self.x, self.y, progressEnd, self.height, self.ProgressBackgroundColour) OSDrawing.DrawBlankArea(self.x + progressEnd, self.y, self.width - progressEnd, self.height, self.BackgroundColour) end