|
Post by zzz000abc on Jul 26, 2024 4:59:04 GMT
here is a small program to make sprite. before you use it follow the instructions given below: 1. make Directories myBmps and mySprites in default directories. 2. to know your defaultdirectory use the code print DefaultDir$ 3. create an image and its mask in both of same size in .bmp formats 4. run the code given below:
for i=1 to 2 imgNm$="mask image" imgUpdw$="imup imdw" input"enter ";word$(imgNm$,i);" name:";img$ p$="myBmps\";word$(img$,1,".");".bmp" p$=DefaultDir$+"\"+p$ loadbmp word$(imgUpdw$,i), p$ print p$ next sprTx$="name width height" for i=1 to 3 input "enter sprite ";word$(sprTx$,i);" : ";s$ ss$=ss$+s$+" " next ss$=trim$(ss$) open "Drawbmp Test" for graphics as #main sprNm$=word$(ss$,1):wid=val(word$(ss$,2)):ht=val(word$(ss$,3)) print wid,ht print #main, "drawbmp ";word$(imgUpdw$,1);" 0 0" print #main, "drawbmp ";word$(imgUpdw$,2);" 0 ";ht print #main,"getbmp tmpSpr 0 0 ";wid;" ";2*ht p$=DefaultDir$+"\mySprites\"+sprNm$+".bmp" bmpsave "tmpSpr",p$ print #main,"trapclose [quit]" wait
[quit] unloadbmp(word$(imgUpdw$,1)) unloadbmp(word$(imgUpdw$,2)) unloadbmp("tmpSpr") close #main end
|
|