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
 
psp/lua_player/library/romero126/draw/horizontalscrollbar.txt · Last modified: 2008/05/15 00:07
 
Recent changes RSS feed Creative Commons License Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki