Gjl,
Here is what you have to do. First you have to know how many objects you need to load. Then you have to know how many objects are loaded. That gives you your first first set of variables.
TotalObjects# = 1000
TotalObjectsLoaded# = 123
Now you get the percentage of TotalObjectsLoaded which is
TotalObjectsLoaded# / TotalObjects#
That gives us our third variable.
TotalObjectsPercent# = TotalObjectsLoaded# / TotalObjects#
The reason you convert it to a percent is because that is is all a bargraph shows is a percentage of something.
Now to draw the actual bar graph.
These here are the basic variables to draw the actual Box
`Defines the upper lefthand corner of the box
`Adjust these two numbers to change the location of where
` your Graph shows up on the screen
BarX# = 100
BarY# = 100
`Defines the height and length of the box
Barlength# = 100
Barheight# = 10
Okay, so how do we adjust the size of the bar to represent the size the box should be? Simple
`How much of the bar to fill
Barfill# = Barlength# * TotalObjectsPercent#
`draws your graph
box BarX#, BarY#, BarX# + Barfill#, boxY# + Barheight#
`This line represents 100% box filled
line BarX#, Bary#, BarX# + Barlength#, bary# + barheight#
Snippet one is Just the Basics to draw the bar
set display mode 1024, 768, 32
ink 255,255
TotalObjects# = 1000
TotalObjectsLoaded# = 123
TotalObjectsPercent# = TotalObjectsLoaded# / TotalObjects#
BarX# = 100
BarY# = 100
Barlength# = 100
Barheight# = 10
Barfill# = Barlength# * TotalObjectsPercent#
box BarX#, BarY#, BarX# + Barfill#, barY# + Barheight#
line BarX# + BarLength#, BarY#, BarX# + barlength#, BarY# + barheight#
wait key
Code Two Allows you to resize the bar using the Left and right Arrow Keys...
set display mode 1024, 768, 32
TotalObjects# = 1000
TotalObjectsLoaded# = 423
TotalObjectsPercent# = TotalObjectsLoaded# / TotalObjects#
BarX# = 200
BarY# = 100
Barlength# = 100
Barheight# = 10
do
cls
TotalObjectsPercent# = TotalObjectsLoaded# / TotalObjects#
Barfill# = Barlength# * TotalObjectsPercent#
box BarX#, BarY#, BarX# + barfill#, barY# + Barheight#
line BarX# + BarLength#, BarY#, BarX# + Barlength#, bary# + barheight#
if rightkey() = 1 and TotalObjectsLoaded# < TotalObjects#
inc TotalObjectsLoaded#
endif
if leftkey() = 1 and TotalObjectsLoaded# > 0
dec TotalObjectsLoaded#
endif
loop
Ralen