' Program: XDraw ' File: XDRAW.BAS ' Date: January 1997 ' Author: Xopl ' Send all comments to: me@XOPL.com ' ' Info: ' ' This is a graphics utility I made for my own use because I couldn't find ' anything that did quite the same thing. This program lets you draw a full ' color image and save it as a QBasic program using a series of DRAW commands. ' It is VERY useful for making graphics for programs. I decided to release ' it to the public so others could benefit from this. ' ' XDraw v1.4 [XDRAW.BAS] Copyright (C) 1997 Xopl ' "Xopl" Copyright (C) 1995-1997 ' You MAY distribute this file as you wish freely, provided that if you are ' distributing you DO NOT alter this file in any way. ' You MAY use this program as a base for other programs and you MAY expand ' upon this file and you MAY use code from this program as example, provided ' that you credit the author, Xopl, and you do not sell it for profit, ' protect it, or otherwise discredit the author, Xopl. ' You MAY use this program to create graphics for your use, freely. ' All code in this program was created from scratch by Xopl. ' ' This isn't really an original idea, and I feel someone could extend this ' to make it even better, so I am giving programers the rights to use this ' to create an even better utility. (I probably will myself) I'd really love ' to see this get even better. ' *This is a beta version* ' ' Commands are explained within the program. File names must follow the ' 8.3 format remember! [Ex. 12345678.bas or abcd.bas or xyz.12] ' Press SHIFT + F5 to run it now. CLS COLOR 15, 4 PRINT " XDraw v1.4 BETA (C) 1997 Xopl " SLEEP (2) COLOR 7, 0 PRINT PRINT PRINT "INIT_VARS:" x = 200 y = 100 clr = 1 SLEEP (1) PRINT PRINT "Use number pad to move. Press to change to the next color. Press " PRINT "to quit. Press to change to a color directly. (by number)" PRINT "TURN NUMLOCK ON" PRINT redo: INPUT "Screen mode 8, 12, or 13? ", mode$ IF mode$ = "8" THEN GOTO 8 IF mode$ = "12" THEN GOTO 12 IF mode$ = "13" THEN GOTO 13 GOTO redo 8 : maxclr = 15 SCREEN 8 GOTO pmain 12 : maxclr = 15 SCREEN 12 GOTO pmain 13 : maxclr = 255 SCREEN 13 GOTO pmain pmain: PRINT INPUT "Save as what? (example: TEST.BAS) ", file$ ON ERROR GOTO whoops OPEN file$ FOR APPEND AS #2 PRINT #2, "screen "; mode$ CLS GOTO main: main: clr$ = STR$(clr) key$ = UCASE$(INKEY$) SELECT CASE key$ CASE CHR$(27): GOTO quit CASE " ": clr = clr + 1: IF clr > maxclr THEN clr = 0 CASE "8": y = y - 1: PRINT #2, "Draw "; CHR$(34); "C"; LTRIM$(clr$); "U1"; CHR$(34) CASE "9": y = y - 1: x = x + 1: PRINT #2, "Draw "; CHR$(34); "C"; LTRIM$(clr$); "E1"; CHR$(34) CASE "6": x = x + 1: PRINT #2, "Draw "; CHR$(34); "C"; LTRIM$(clr$); "R1"; CHR$(34) CASE "3": y = y + 1: x = x + 1: PRINT #2, "Draw "; CHR$(34); "C"; LTRIM$(clr$); "F1"; CHR$(34) CASE "2": y = y + 1: PRINT #2, "Draw "; CHR$(34); "C"; LTRIM$(clr$); "D1"; CHR$(34) CASE "1": y = y + 1: x = x - 1: PRINT #2, "Draw "; CHR$(34); "C"; LTRIM$(clr$); "G1"; CHR$(34) CASE "4": x = x - 1: PRINT #2, "Draw "; CHR$(34); "C"; LTRIM$(clr$); "L1"; CHR$(34) CASE "7": y = y - 1: x = x - 1: PRINT #2, "Draw "; CHR$(34); "C"; LTRIM$(clr$); "H1"; CHR$(34) CASE "C": GOSUB clr.chng END SELECT LOCATE 1, 1, 0 COLOR clr PRINT "CLR = "; clr PSET (x, y), clr GOTO main clr.chng: LOCATE 1, 1, 0 LINE INPUT "CLR = ? ", clr$ clr = VAL(clr$) IF clr > maxclr THEN GOTO clr.chng RETURN whoops: PRINT PRINT PRINT "Bad file name or other error." PRINT "Restart Program." PRINT PRINT "@"; ERR; ": "; HEX$(ERR * ERR) RESUME fatal fatal: quit: CLOSE #2