Post by Admin on Jan 12, 2020 3:28:58 GMT
Although unnecessary, I have decided to dig up the original demo program that started this. I created this crude
drawing tool on October 3, 2016 long before it became part of RETROLIB (see the next post to understand what happened next)
drawing tool on October 3, 2016 long before it became part of RETROLIB (see the next post to understand what happened next)
VDU 23,22,1024;600;8,15,16,1 :REM max width is 1920 and 1440 height
GCOL 6
REM PEN UP
PROCgo("up",0)
REM go north east (45 degrees) 500 points
PROCgo("ne",500)
PROCgo("down",100)
PROCgo("n",100)
PROCgo("ne",100)
PROCgo("e",100)
PROCgo("se",100)
PROCgo("s",100)
PROCgo("sw",100)
PROCgo("w",100)
PROCgo("nw",100)
REM Pen up
PROCgo("up",0)
REM move east 10 pixels
PROCgo("e",10)
REM in this case, fill flood fills the chosen area with color 12 and it works with pen up
PROCgo("fill",12)
END
DEFPROCgo(cmd$,coun%)
PRIVATE x%,y%,pen%
LOCAL c%
IF cmd$="up" THEN pen%=1
IF cmd$="down" THEN pen%=0
IF cmd$="fill" THEN GCOL coun%:FILL x%,y%
IF cmd$="n" THEN
REPEAT
y%=y%+1:IF pen%=0 THEN MOVE x%,y%:DRAW x%,y%
c%+=1
UNTIL c%=coun%
ENDIF
IF cmd$="s" THEN
REPEAT
y%=y%-1:IF pen%=0 THEN MOVE x%,y%:DRAW x%,y%
c%+=1
UNTIL c%=coun%
ENDIF
IF cmd$="e" THEN
REPEAT
x%+=1:IF pen%=0 THEN MOVE x%,y%:DRAW x%,y%
c%+=1
UNTIL c%=coun%
ENDIF
IF cmd$="w" THEN
REPEAT
x%-=1:IF pen%=0 THEN MOVE x%,y%:DRAW x%,y%
c%+=1
UNTIL c%=coun%
ENDIF
IF cmd$="ne" THEN
REPEAT
x%+=1:y%+=1:IF pen%=0 THEN MOVE x%,y%:DRAW x%,y%
c%+=1
UNTIL c%=coun%
ENDIF
IF cmd$="nw" THEN
REPEAT
x%-=1:y%+=1:IF pen%=0 THEN MOVE x%,y%:DRAW x%,y%
c%+=1
UNTIL c%=coun%
ENDIF
IF cmd$="sw" THEN
REPEAT
x%-=1:y%-=1:IF pen%=0 THEN MOVE x%,y%:DRAW x%,y%
c%+=1
UNTIL c%=coun%
ENDIF
IF cmd$="se" THEN
REPEAT
x%+=1:y%-=1:IF pen%=0 THEN MOVE x%,y%:DRAW x%,y%
c%+=1
UNTIL c%=coun%
ENDIF
ENDPROC