call screen 1200,800' I made this for a generic host screen call (#h-window) #h.1 is graphic box. #h.1 "down; fill black" gcolor$= "white" ' lets give a default color hpos=0 vpos=0 open "recorder" for output as #f '**********name**x***y***size*R***G**B*Dimmer call ring "ring",100,300,100,200,150,200,4 '^^^^^^ nameing it ring gives the BMP image a name.. '^^^^^^ it will become ring1 after in later sprite commands. '^^^^^^ this will now apply to sphere as well mx=100' I set the location of the sprite to mx, my locations for mouse my=100 [loop] '****** I put ring1 instead of ring because it was renamed for sprite #h.1 "spritexy ring1 ";mx;" ";my print #f, mx print #f, my '****** remember that for future names you will always add 1 to the name '#h.1 "spritemovexy ring1 1 1" mx=MouseX my=MouseY #h.1 "drawsprites" scan #h.1 "when leftButtonMove [loop]" wait [quit] #h.1 "discard" close #f close #h end ' LOOK UP ^^^^ that's how big your code is with description. ' Making sprites never was so easy '*************************************************************** '***** I moved the globals down to make a clean work space * '*************************************************************** sub screen x,y nomainwin WindowWidth=x WindowHeight=y UpperLeftX=0 UpperLeftY=0 global name$ global name1$ global getsizeh' globals have been moved to make it a cleaner interface global getsizev global hpos ' the horizontal locators for ENTER sub global vpos ' the vertical locator for ENTER sub global gcolor$ ' YOU MUST DEFINE gcolor$ BEFORE you use GRPRINT or ENTER but it only needs to be done once graphicbox #h.1, 0,0,1000,700 open "Generic Window Host" for window_nf as #h print #h, "trapclose [quit]" end sub sub ring n$,h,v,size,x,c,a,dimmer ' dimmer cannot be more than 24- this command is sprite ready name$=n$' see if assigning the global variable to n$ will solve the error hpos=h-size ' get the starting location for image capture calcv=size*3 vpos=v-calcv #h.1 "place ";h-5;" ";v-size #h.1 "down;color white" othervar=size*2 othervar2=size bh=h-size : bv=v-othervar-othervar2-5 : v2=size*2 othersize=size+2 for fnl=1 to othersize*2 st=st+1 #h.1 "line ";bh;" ";bv+st;" ";bh+v2;" ";bv+st next fnl nv= size*2 nv2= v-nv #h.1 "place ";h;" ";nv2 #h.1 "color black" #h.1 "backcolor black" #h.1 "circlefilled ";size getsizeh= size*2 getsizev= size*4 rsize= size/4 inner=rsize/2 fcenter=size-rsize r=0 switch=0 for y=1 to size #h.1 "place ";h;" ";v #h.1 "down" #h.1 "color ";x;" ";c;" ";a #h.1 "size 2" r=r+1 if fcenter+r> size then switch=1:goto [jump] #h.1 "circle ";fcenter-r #h.1 "circle ";fcenter+r [jump] if switch=1 then print #h.1, "place ";h;" ";nv2;"down;color white;backcolor white;circlefilled ";fcenter-r x=x-dimmer c=c-dimmer a=a-dimmer if x<2 then x=2 if c<2 then c=2 if a<2 then a=2 next y #h.1 "flush" #h.1 "getbmp ";name$;" ";hpos;" ";vpos;" ";getsizeh;" ";getsizev name1$=name$+"1" #h.1 "addsprite ";name1$;" ";name$ #h.1 "centersprite ";name1$ end sub sub enter message$ #h.1 "place ";hpos;" ";vpos #h.1 "backcolor black" #h.1 "color ";gcolor$ #h.1 "\";message$ vpos=vpos+20 end sub sub gline x,y,h,v ' its my attempt to bring back a line command. like in the old days #h.1 "backcolor black" #h.1 "color ";gcolor$ #h.1 "line ";x;" ";y;" ";h;" ";v end sub sub grprint x,y,message$ #h.1 "backcolor black" #h.1 "up" #h.1 "place ";x;" ";y #h.1 "down" #h.1 "color ";gcolor$ #h.1 "\";message$ end sub sub sphere n$,h,v,size,x,c,a,dimmer ' dimmer cannot be more than 24- this command is sprite ready name$=n$ hpos=h-size ' get the starting location for image capture calcv=size*3 vpos=v-calcv #h.1 "place ";h-5;" ";v-size #h.1 "down;color white" othervar=size*2 othervar2=size bh=h-size : bv=v-othervar-othervar2-5 : v2=size*2 othersize=size+2 for fnl=1 to othersize*2 st=st+1 #h.1 "line ";bh;" ";bv+st;" ";bh+v2;" ";bv+st next fnl nv= size*2 nv2= v-nv #h.1 "place ";h;" ";nv2 #h.1 "color black" #h.1 "backcolor black" #h.1 "circlefilled ";size getsizeh= size*2 getsizev= size*4 for y=1 to size #h.1 "place ";h;" ";v #h.1 "down" #h.1 "color ";x;" ";c;" ";a #h.1 "size 2" #h.1 "circle ";y x=x-dimmer c=c-dimmer a=a-dimmer if x<2 then x=2 if c<2 then c=2 if a<2 then a=2 next y #h.1 "flush" #h.1 "getbmp ";name$;" ";hpos;" ";vpos;" ";getsizeh;" ";getsizev name1$=name$+"1" #h.1 "addsprite ";name1$;" ";name$ #h.1 "centersprite ";name1$ end sub 'block h,v,size,R,G,B,dimmer sub block h,v,size,x,c,a,dimmer ' dimmer cannot be more than 24 #h.1 "place ";h;" ";v p=size/2 for y=1 to size #h.1 "down" #h.1 "color ";x;" ";c;" ";a #h.1 "size 1" print #h.1, "line ";h-y;" ";v-y;" ";h+y;" ";v-y print #h.1, "line ";h+y;" ";v-y;" ";h+y;" ";v+y print #h.1, "line ";h+y;" ";v+y;" ";h-y;" ";v+y print #h.1, "line ";h-y;" ";v+y;" ";h-y;" ";v-y x=x-dimmer c=c-dimmer a=a-dimmer if x<2 then x=2 if c<2 then c=2 if a<2 then a=2 p=p-1 next y end sub 'ellipse h,v,sizex,sizey,R,G,B,dimmer sub ellipse h,v,sizex,sizey,x,c,a,dimmer ' dimmer cannot be more than 24 #h.1 "place ";h;" ";v if sizex>sizey then limit=sizex if sizey>sizex then limit=sizey for y=1 to limit #h.1 "down" #h.1 "color ";x;" ";c;" ";a #h.1 "size 2" hi=hi+1:if sizex>sizey then hi=hi+1 wi=wi+1:if sizey>sizex then wi=wi+1 if hi>sizex then hi=sizex if wi>sizey then wi=sizey #h.1 "ellipse ";hi;" ";wi x=x-dimmer c=c-dimmer a=a-dimmer if x<2 then x=2 if c<2 then c=2 if a<2 then a=2 next y end sub sub rect x,y,h,v #h.1 "down" #h.1 "color ";gcolor$ #h.1 "size 1" print #h.1, "line ";x;" ";y;" ";h;" ";y print #h.1, "line ";h;" ";y;" ";h;" ";v print #h.1, "line ";h;" ";v;" ";x;" ";v print #h.1, "line ";x;" ";v;" ";x;" ";y end sub
call screen 1200,800' I made this for a generic host screen call (#h-window) #h.1 is graphic box. #h.1 "down; fill black" gcolor$= "white" ' lets give a default color hpos=0 vpos=0 open "recorder" for input as #f '**********name**x***y***size*R***G**B*Dimmer call ring "ring",100,300,100,200,150,200,4 '^^^^^^ nameing it ring gives the BMP image a name.. '^^^^^^ it will become ring1 after in later sprite commands. '^^^^^^ this will now apply to sphere as well mx=100' I set the location of the sprite to mx, my locations for mouse my=100 [loop] '****** I put ring1 instead of ring because it was renamed for sprite #h.1 "spritexy ring1 ";mx;" ";my input #f, mx input #f, my call pause 10 if eof(#f)<0 then [quit] '****** remember that for future names you will always add 1 to the name '#h.1 "spritemovexy ring1 1 1" 'mx=MouseX 'my=MouseY #h.1 "drawsprites" scan '#h.1 "when leftButtonMove [loop]" goto [loop] wait [quit] #h.1 "discard" close #f close #h end ' LOOK UP ^^^^ that's how big your code is with description. ' Making sprites never was so easy '*************************************************************** '***** I moved the globals down to make a clean work space * '*************************************************************** sub pause mil t=time$("milliseconds") while time$("milliseconds")<t+mil wend end sub sub screen x,y nomainwin WindowWidth=x WindowHeight=y UpperLeftX=0 UpperLeftY=0 global name$ global name1$ global getsizeh' globals have been moved to make it a cleaner interface global getsizev global hpos ' the horizontal locators for ENTER sub global vpos ' the vertical locator for ENTER sub global gcolor$ ' YOU MUST DEFINE gcolor$ BEFORE you use GRPRINT or ENTER but it only needs to be done once graphicbox #h.1, 0,0,1000,700 open "Generic Window Host" for window_nf as #h print #h, "trapclose [quit]" end sub sub ring n$,h,v,size,x,c,a,dimmer ' dimmer cannot be more than 24- this command is sprite ready name$=n$' see if assigning the global variable to n$ will solve the error hpos=h-size ' get the starting location for image capture calcv=size*3 vpos=v-calcv #h.1 "place ";h-5;" ";v-size #h.1 "down;color white" othervar=size*2 othervar2=size bh=h-size : bv=v-othervar-othervar2-5 : v2=size*2 othersize=size+2 for fnl=1 to othersize*2 st=st+1 #h.1 "line ";bh;" ";bv+st;" ";bh+v2;" ";bv+st next fnl nv= size*2 nv2= v-nv #h.1 "place ";h;" ";nv2 #h.1 "color black" #h.1 "backcolor black" #h.1 "circlefilled ";size getsizeh= size*2 getsizev= size*4 rsize= size/4 inner=rsize/2 fcenter=size-rsize r=0 switch=0 for y=1 to size #h.1 "place ";h;" ";v #h.1 "down" #h.1 "color ";x;" ";c;" ";a #h.1 "size 2" r=r+1 if fcenter+r> size then switch=1:goto [jump] #h.1 "circle ";fcenter-r #h.1 "circle ";fcenter+r [jump] if switch=1 then print #h.1, "place ";h;" ";nv2;"down;color white;backcolor white;circlefilled ";fcenter-r x=x-dimmer c=c-dimmer a=a-dimmer if x<2 then x=2 if c<2 then c=2 if a<2 then a=2 next y #h.1 "flush" #h.1 "getbmp ";name$;" ";hpos;" ";vpos;" ";getsizeh;" ";getsizev name1$=name$+"1" #h.1 "addsprite ";name1$;" ";name$ #h.1 "centersprite ";name1$ end sub sub enter message$ #h.1 "place ";hpos;" ";vpos #h.1 "backcolor black" #h.1 "color ";gcolor$ #h.1 "\";message$ vpos=vpos+20 end sub sub gline x,y,h,v ' its my attempt to bring back a line command. like in the old days #h.1 "backcolor black" #h.1 "color ";gcolor$ #h.1 "line ";x;" ";y;" ";h;" ";v end sub sub grprint x,y,message$ #h.1 "backcolor black" #h.1 "up" #h.1 "place ";x;" ";y #h.1 "down" #h.1 "color ";gcolor$ #h.1 "\";message$ end sub sub sphere n$,h,v,size,x,c,a,dimmer ' dimmer cannot be more than 24- this command is sprite ready name$=n$ hpos=h-size ' get the starting location for image capture calcv=size*3 vpos=v-calcv #h.1 "place ";h-5;" ";v-size #h.1 "down;color white" othervar=size*2 othervar2=size bh=h-size : bv=v-othervar-othervar2-5 : v2=size*2 othersize=size+2 for fnl=1 to othersize*2 st=st+1 #h.1 "line ";bh;" ";bv+st;" ";bh+v2;" ";bv+st next fnl nv= size*2 nv2= v-nv #h.1 "place ";h;" ";nv2 #h.1 "color black" #h.1 "backcolor black" #h.1 "circlefilled ";size getsizeh= size*2 getsizev= size*4 for y=1 to size #h.1 "place ";h;" ";v #h.1 "down" #h.1 "color ";x;" ";c;" ";a #h.1 "size 2" #h.1 "circle ";y x=x-dimmer c=c-dimmer a=a-dimmer if x<2 then x=2 if c<2 then c=2 if a<2 then a=2 next y #h.1 "flush" #h.1 "getbmp ";name$;" ";hpos;" ";vpos;" ";getsizeh;" ";getsizev name1$=name$+"1" #h.1 "addsprite ";name1$;" ";name$ #h.1 "centersprite ";name1$ end sub 'block h,v,size,R,G,B,dimmer sub block h,v,size,x,c,a,dimmer ' dimmer cannot be more than 24 #h.1 "place ";h;" ";v p=size/2 for y=1 to size #h.1 "down" #h.1 "color ";x;" ";c;" ";a #h.1 "size 1" print #h.1, "line ";h-y;" ";v-y;" ";h+y;" ";v-y print #h.1, "line ";h+y;" ";v-y;" ";h+y;" ";v+y print #h.1, "line ";h+y;" ";v+y;" ";h-y;" ";v+y print #h.1, "line ";h-y;" ";v+y;" ";h-y;" ";v-y x=x-dimmer c=c-dimmer a=a-dimmer if x<2 then x=2 if c<2 then c=2 if a<2 then a=2 p=p-1 next y end sub 'ellipse h,v,sizex,sizey,R,G,B,dimmer sub ellipse h,v,sizex,sizey,x,c,a,dimmer ' dimmer cannot be more than 24 #h.1 "place ";h;" ";v if sizex>sizey then limit=sizex if sizey>sizex then limit=sizey for y=1 to limit #h.1 "down" #h.1 "color ";x;" ";c;" ";a #h.1 "size 2" hi=hi+1:if sizex>sizey then hi=hi+1 wi=wi+1:if sizey>sizex then wi=wi+1 if hi>sizex then hi=sizex if wi>sizey then wi=sizey #h.1 "ellipse ";hi;" ";wi x=x-dimmer c=c-dimmer a=a-dimmer if x<2 then x=2 if c<2 then c=2 if a<2 then a=2 next y end sub sub rect x,y,h,v #h.1 "down" #h.1 "color ";gcolor$ #h.1 "size 1" print #h.1, "line ";x;" ";y;" ";h;" ";y print #h.1, "line ";h;" ";y;" ";h;" ";v print #h.1, "line ";h;" ";v;" ";x;" ";v print #h.1, "line ";x;" ";v;" ";x;" ";y end sub