I have written a game that has a menu system that uses sprites. With the game I have made a program to help edit data for the game. There can be many menus open at one time, but I kinda need to not sync through all the menus because it creates a massive lag. Is there a way to refresh certain sprites and still display all of them?
My sprite painting method:
function show_AlWin
load image "Menu/bkrnd.bmp",1
load image "Menu/Close.bmp",2
OTS=text size()
spn=1
for wc=0 to numWin-1
rem ***Win
if Win(wc).Bkrnd
sprite spn,Win(wc).xPos,Win(wc).yPos,1
size sprite spn,Win(wc).xSize,Win(wc).ySize
hide sprite spn
diff_sprite(spn, "bkrnd")
paste sprite spn,Win(wc).xPos,Win(wc).yPos
spn=spn+1
else
spn=spn+1
endif
if Win(wc).Top=1
sprite spn,Win(wc).xPos,Win(wc).yPos-15,1
size sprite spn,Win(wc).xSize,15
hide sprite spn
diff_sprite(spn, "White")
paste sprite spn,Win(wc).xPos,Win(wc).yPos-15
spn=spn+1
cxp=Win(wc).xPos+Win(wc).xSize-12
cyp=Win(wc).yPos-12
sprite spn,cxp,cyp,2
size sprite spn,10,10
hide sprite spn
paste sprite spn,cxp,cyp
else
spn=spn+1
endif
cimg=3
rem ****Buttons
if Win(wc).Btn_min>=0
for wb=Win(wc).Btn_min to Win(wc).Btn_max
xmn=Btn(wb).xPos+Win(wc).xPos
xmx=xmn+Btn(wb).xSize
xch2=mousex()>=xmn and mousex()<=xmx
ymn=Btn(wb).yPos+Win(wc).yPos
ymx=ymn+Btn(wb).ySize
ych2=mousey()>=ymn and mousey()<=ymx
if xch2 AND ych2 AND file exist("Menu/"+Btn(wb).Img$+"2.bmp")=1
load image "Menu/"+Btn(wb).Img$+"2.bmp",cimg
else
load image "Menu/"+Btn(wb).Img$+".bmp",cimg
endif
sprite spn,Btn(wb).xPos+Win(wc).xPos,Btn(wb).yPos+Win(wc).yPos,cimg
size sprite spn,Btn(wb).xSize,Btn(wb).ySize
hide sprite spn
if Btn(wb).Enabled=0
set sprite alpha spn,128
else
set sprite alpha spn,255
endif
paste sprite spn,Btn(wb).xPos+Win(wc).xPos,Btn(wb).yPos+Win(wc).yPos
cimg=cimg+1
spn=spn+1
next wb
endif
rem ****labels
if Win(wc).Lbl_min>=0
for wl=Win(wc).Lbl_min to Win(wc).Lbl_max
Lbl(wl).sNum=spn
sprite spn,Lbl(wl).xPos+Win(wc).xPos,Lbl(wl).yPos+Win(wc).yPos,1
size sprite spn,Lbl(wl).xSize,Lbl(wl).ySize
hide sprite spn
paste sprite spn,Lbl(wl).xPos+Win(wc).xPos,Lbl(wl).yPos+Win(wc).yPos
ink rgb(0,0,0), rgb(255,255,255)
if Lbl(wl).Data$=""
Lbl(wl).Data$=Lbl(wl).Name$
endif
set text font "Arial"
set text size Lbl(wl).ySize
text Lbl(wl).xPos+Win(wc).xPos,Lbl(wl).yPos+Win(wc).yPos,Lbl(wl).Data$
set text size 15
spn=spn+1
next wl
endif
next wc
while sprite exist(spn)
delete sprite spn
spn=spn+1
endwhile
endfunction
no not that thechew guy again