Made this function that should allow you to load anything in from a function, however I can not put may finger on why the bar does not up date correctly
if using this which I working fine in my weather program but now I've take bits of it out it will not work.
this is the line thats mucking things up.
rem pp#=(volume/12*100)*barsize_x/100
P# = (loadingcount/loadingtotal*100.0)*width/100.0
the rem one is what works ok in the weather code, but when adaptive for this code does not work, is my maths or something else?
Rem Created: Tuesday, August 10, 2010
rem star loading bar
autocam off
sync on
backdrop on
x=200
y=300
width=400
height=15
global count=1
global total=3
id=1
`repeat
wait 4000
sync
bar(x, y, width, height,18,"cube1.dbo","",id,0,count,total )
sync
inc count,1
inc id
wait 1000
bar(x, y, width, height,18,"sphere1.dbo","",id,0,count,total )
sync
inc count,1
inc id
wait 1000
bar(x, y, width, height,18,"cube1.dbo","",id,0,count,total )
sync
print "done"
wait key
`until spacekey()=1
end
function bar(x, y, width as float, height,filetype,filename as string,filename2 as string, idnumber,id2number,loadingcount as float,loadingTotal as float )
select filetype
case 1: load 3dsound filename,idnumber : endcase
case 2: load animation filename,idnumber : endcase
rem case 3: load array filename, filename2 : endcase
rem case 4: load array from datafile filename, idnumber : endcase
rem case 5: load arrayptr from datafile filename,idnumber :endcase
case 6: load bitmap filename, idnumber :endcase
case 7: load bsp filename,filename2 :endcase
rem case 8: load camera effect filename,idnumber :endcase
case 9: load cdmusic idnumber,id2number :endcase
rem case 10: load cloth state filename,idnumber :endcase
case 11: load dll filename,idnumber :endcase
case 12: load dvd animation idnumber :endcase
rem case 13: load effect filename,idnumber,id2number :endcase
rem case 14: load icon (filename) :endcase
case 15: load image filename,idnumber :endcase
case 16: load mesh filename,idnumber :endcase
case 17: load music filename,idnumber :endcase
case 18: load object filename,idnumber :endcase
rem case 19: load sound filename,idnumber :endcase
rem case 20: load static objects filename,idnumber :endcase
rem case 21: load terrain filename,idnumber :endcase
case default : endcase
endselect
text 0,0,str$(loadingcount)
rem pp#=(volume/12*100)*barsize_x/100
P# = (loadingcount/loadingtotal*100.0)*width/100.0
text 0,20,str$(p#)
if P#<0.0 then P#=0.0
rem gradient bar
seg = width / 3
box x, y, x+seg, y+height, rgb(0,0,0),rgb(0,0,0),rgb(85,0,0),rgb(85,0,0)
box x+seg, y, x+seg+seg, y+height, rgb(85,0,0),rgb(85,0,0),rgb(170,0,0),rgb(170,0,0)
box x+seg+seg, y, x+width, y+height, rgb(170,0,0),rgb(170,0,0),rgb(255,0,0),rgb(255,0,0)
rem empty bit
ink rgb(92,92,92),0
box x+width*P#, y, x+width, y+height
rem highlight
c1 = 0xCCFFFFFF
c2 = 0x33FFFFFF
box x, y, x+width, y+height*0.5, c2,c1,c2,c1
ink rgb(255,255,255)
endfunction
Dark Physics makes any hot drink go cold.