nomainwin
WindowWidth = 600
WindowHeight = 300
open "Transparency Test" for graphics_nsb as #gr
#gr "trapclose [quit]"
#gr "size 2"
#gr "down"
d = 100
for i = 0 to 255
c$ = i;" ";i;" ";i
#gr "color ";c$
#gr "line ";i*2;" ";0;" ";i*2;" ";d
c$ = 255-i;" ";0;" ";0
#gr "color ";c$
#gr "line ";i*2;" ";d;" ";i*2;" ";2*d
next
#gr "getbmp sprite 0 0 511 ";2*d
for i = 1 to 100
#gr "backcolor ";int(rnd(1)*255);" ";int(rnd(1)*255);" ";int(rnd(1)*255)
#gr "place ";int(rnd(1)*600);" ";int(rnd(1)*300)
#gr "circlefilled ";int(rnd(1)*100+10)
next
#gr "getbmp bg 0 0 600 280"
#gr "background bg"
#gr "Addsprite sprite sprite"
#gr "Spritexy sprite 44 80"
#gr, "Drawsprites"
wait
'-----------------------------------
[quit]
close #gr
call tryUnloadBMP "sprite"
call tryUnloadBMP "bg"
end
sub tryUnloadBMP picName$
on error goto [dontCare]
unloadbmp picName$
[dontCare]
end sub