Code archives/Miscellaneous/Working Bar

This code has been declared by its author to be Public Domain code.

Download source code

Working Bar by Rob Farley2002
Want a working bar... well here's one!

Usage:

working_bar([x position],[y position],[width],[height],[current position],[maximum position],[red],[green],[blue],[background red],[background green],[background blue])

Maximum position is the top value, so if you're looping from 0 to 500 then 500 would be the top value.

Current position is the current position in your loop.
; Working Bar - By Rob Farley 2002
; web: http://www.mentalillusion.co.uk
; email: rob@mentalillusion.co.uk
; working_bar([x position],[y position],[width],[height],[current position],
; [maximum position],[red],[green],[blue],[background red],[background green],[background blue])

Function working_bar(x,y,width#,height,pos#,top#,r,g,b,bgr,bgg,bgb)
Color bgr,bgg,bgb
Rect x,y,width,height
real_width#=((width#-4)/top#)*pos#
Color r,g,b
Rect x+2,y+2,real_width#,height-4
End Function

Comments

None.

Code Archives Forum