This function draws a HorizontalScrollbar
nil Draw:HorizontalScrollBar(x, y, w, h, percent, offsetpercent, _color, _barcolor, _bgcolor)
function Draw:HorizontalScrollBar(x, y, w, h, percent, offsetpercent, _color, _barcolor, _bgcolor) local _color = _color or Color.new(0,0,0) local _barcolor = _barcolor or Color.new(100,100,255) screen:drawLine(x, y, x, y+h-1, _color) screen:drawLine(x+w, y, x+w, y+h-1, _color) screen:drawLine(x, y, x+w, y, _color) screen:drawLine(x, y+h-1, x+w, y+h-1, _color) if _bgcolor ~= nil then screen:fillRect(x+1, y+1, w-2, h-2, _bgcolor) end local barsize = math.floor( (w-2) * percent ) local offset = math.floor( ((w-2) - barsize) * offsetpercent ) screen:fillRect(x+1+offset, y+1,barsize, h-2, _barcolor) end