PRINT "qbPaint 0.5" _TITLE "qbPaint" PRINT "by markus" PRINT "Get updates from - http://pastebin.com/fj6ds1hw" SLEEP (1) SCREEN _NEWIMAGE(840, 480, 256) COLOR 15, 0 PSET (29, 71), 1 LINE (234, 204)-(234, 231), 34 LINE (234, 204)-(234, 231), 34 LINE (235, 204)-(235, 231), 34 LINE (234, 205)-(234, 232), 34 LINE (236, 204)-(236, 231), 34 LINE (234, 206)-(234, 233), 34 LINE (235, 232)-(263, 232), 34 LINE (236, 232)-(264, 232), 34 LINE (235, 233)-(263, 233), 34 LINE (237, 232)-(265, 232), 34 LINE (235, 234)-(263, 234), 34 LINE (263, 204)-(263, 232), 34 LINE (264, 204)-(264, 232), 34 LINE (263, 205)-(263, 233), 34 LINE (265, 204)-(265, 232), 34 LINE (263, 206)-(263, 234), 34 LINE (236, 205)-(264, 205), 34 LINE (237, 205)-(265, 205), 34 LINE (236, 206)-(264, 206), 34 LINE (238, 205)-(266, 205), 34 LINE (236, 207)-(264, 207), 34 LINE (265, 196)-(265, 261), 34 LINE (266, 196)-(266, 261), 34 LINE (265, 197)-(265, 262), 34 LINE (267, 196)-(267, 261), 34 LINE (265, 198)-(265, 263), 34 LINE (278, 234)-(278, 167), 35 LINE (279, 234)-(279, 167), 35 LINE (278, 235)-(278, 168), 35 LINE (280, 234)-(280, 167), 35 LINE (278, 236)-(278, 169), 35 LINE (279, 234)-(304, 234), 35 LINE (280, 234)-(305, 234), 35 LINE (279, 235)-(304, 235), 35 LINE (281, 234)-(306, 234), 35 LINE (279, 236)-(304, 236), 35 LINE (304, 207)-(304, 234), 35 LINE (305, 207)-(305, 234), 35 LINE (304, 208)-(304, 235), 35 LINE (306, 207)-(306, 234), 35 LINE (304, 209)-(304, 236), 35 LINE (304, 207)-(279, 208), 35 LINE (305, 207)-(280, 208), 35 LINE (304, 208)-(279, 209), 35 LINE (306, 207)-(281, 208), 35 LINE (304, 209)-(279, 210), 35 LINE (338, 233)-(338, 160), 40 LINE (339, 233)-(339, 160), 40 LINE (338, 234)-(338, 161), 40 LINE (340, 233)-(340, 160), 40 LINE (338, 235)-(338, 162), 40 LINE (339, 161)-(370, 161), 40 LINE (340, 161)-(371, 161), 40 LINE (339, 162)-(370, 162), 40 LINE (341, 161)-(372, 161), 40 LINE (339, 163)-(370, 163), 40 LINE (370, 184)-(370, 162), 40 LINE (371, 184)-(371, 162), 40 LINE (370, 185)-(370, 163), 40 LINE (372, 184)-(372, 162), 40 LINE (370, 186)-(370, 164), 40 LINE (371, 184)-(339, 184), 40 LINE (372, 184)-(340, 184), 40 LINE (371, 185)-(339, 185), 40 LINE (373, 184)-(341, 184), 40 LINE (371, 186)-(339, 186), 40 LINE (382, 202)-(381, 230), 43 LINE (383, 202)-(382, 230), 43 LINE (382, 203)-(381, 231), 43 LINE (384, 202)-(383, 230), 43 LINE (382, 204)-(381, 232), 43 LINE (382, 231)-(414, 231), 43 LINE (383, 231)-(415, 231), 43 LINE (382, 232)-(414, 232), 43 LINE (384, 231)-(416, 231), 43 LINE (382, 233)-(414, 233), 43 LINE (414, 231)-(414, 202), 43 LINE (415, 231)-(415, 202), 43 LINE (414, 232)-(414, 203), 43 LINE (416, 231)-(416, 202), 43 LINE (414, 233)-(414, 204), 43 LINE (414, 202)-(383, 203), 43 LINE (415, 202)-(384, 203), 43 LINE (414, 203)-(383, 204), 43 LINE (416, 202)-(385, 203), 43 LINE (414, 204)-(383, 205), 43 LINE (415, 197)-(414, 232), 43 LINE (416, 197)-(415, 232), 43 LINE (415, 198)-(414, 233), 43 LINE (417, 197)-(416, 232), 43 LINE (415, 199)-(414, 234), 43 LINE (415, 225)-(422, 233), 43 LINE (416, 225)-(423, 233), 43 LINE (415, 226)-(422, 234), 43 LINE (417, 225)-(424, 233), 43 LINE (415, 227)-(422, 235), 43 LINE (439, 232)-(462, 231), 47 LINE (440, 232)-(463, 231), 47 LINE (439, 233)-(462, 232), 47 LINE (441, 232)-(464, 231), 47 LINE (439, 234)-(462, 233), 47 LINE (439, 232)-(464, 233), 47 LINE (440, 232)-(465, 233), 47 LINE (439, 233)-(464, 234), 47 LINE (441, 232)-(466, 233), 47 LINE (439, 234)-(464, 235), 47 LINE (453, 233)-(450, 194), 47 LINE (454, 233)-(451, 194), 47 LINE (453, 234)-(450, 195), 47 LINE (455, 233)-(452, 194), 47 LINE (453, 235)-(450, 196), 47 LINE (440, 194)-(451, 195), 47 LINE (441, 194)-(452, 195), 47 LINE (440, 195)-(451, 196), 47 LINE (442, 194)-(453, 195), 47 LINE (440, 196)-(451, 197), 47 LINE (450, 177)-(451, 195), 47 LINE (451, 177)-(452, 195), 47 LINE (450, 178)-(451, 196), 47 LINE (452, 177)-(453, 195), 47 LINE (450, 179)-(451, 197), 47 LINE (450, 177)-(451, 195), 0 LINE (451, 177)-(452, 195), 0 LINE (450, 178)-(451, 196), 0 LINE (452, 177)-(453, 195), 0 LINE (450, 179)-(451, 197), 0 LINE (441, 195)-(457, 195), 48 LINE (442, 195)-(458, 195), 48 LINE (441, 196)-(457, 196), 48 LINE (443, 195)-(459, 195), 48 LINE (441, 197)-(457, 197), 48 LINE (451, 177)-(451, 177), 48 LINE (452, 177)-(452, 177), 48 LINE (451, 178)-(451, 178), 48 LINE (453, 177)-(453, 177), 48 LINE (451, 179)-(451, 179), 48 LINE (449, 180)-(451, 177), 48 LINE (450, 180)-(452, 177), 48 LINE (449, 181)-(451, 178), 48 LINE (451, 180)-(453, 177), 48 LINE (449, 182)-(451, 179), 48 LINE (449, 180)-(452, 180), 48 LINE (450, 180)-(453, 180), 48 LINE (449, 181)-(452, 181), 48 LINE (451, 180)-(454, 180), 48 LINE (449, 182)-(452, 182), 48 LINE (453, 178)-(452, 180), 48 LINE (454, 178)-(453, 180), 48 LINE (453, 179)-(452, 181), 48 LINE (455, 178)-(454, 180), 48 LINE (453, 180)-(452, 182), 48 LINE (484, 235)-(483, 196), 53 LINE (485, 235)-(484, 196), 53 LINE (484, 236)-(483, 197), 53 LINE (486, 235)-(485, 196), 53 LINE (484, 237)-(483, 198), 53 LINE (484, 205)-(495, 196), 53 LINE (485, 205)-(496, 196), 53 LINE (484, 206)-(495, 197), 53 LINE (486, 205)-(497, 196), 53 LINE (484, 207)-(495, 198), 53 LINE (512, 198)-(495, 196), 53 LINE (513, 198)-(496, 196), 53 LINE (512, 199)-(495, 197), 53 LINE (514, 198)-(497, 196), 53 LINE (512, 200)-(495, 198), 53 LINE (512, 198)-(514, 233), 53 LINE (513, 198)-(515, 233), 53 LINE (512, 199)-(514, 234), 53 LINE (514, 198)-(516, 233), 53 LINE (512, 200)-(514, 235), 53 LINE (512, 198)-(515, 235), 53 LINE (513, 198)-(516, 235), 53 LINE (512, 199)-(515, 236), 53 LINE (514, 198)-(517, 235), 53 LINE (512, 200)-(515, 237), 53 LINE (551, 168)-(550, 234), 62 LINE (552, 168)-(551, 234), 62 LINE (551, 169)-(550, 235), 62 LINE (553, 168)-(552, 234), 62 LINE (551, 170)-(550, 236), 62 LINE (551, 234)-(561, 235), 62 LINE (552, 234)-(562, 235), 62 LINE (551, 235)-(561, 236), 62 LINE (553, 234)-(563, 235), 62 LINE (551, 236)-(561, 237), 62 LINE (568, 224)-(563, 235), 62 LINE (569, 224)-(564, 235), 62 LINE (568, 225)-(563, 236), 62 LINE (570, 224)-(565, 235), 62 LINE (568, 226)-(563, 237), 62 LINE (537, 181)-(564, 181), 62 LINE (538, 181)-(565, 181), 62 LINE (537, 182)-(564, 182), 62 LINE (539, 181)-(566, 181), 62 LINE (537, 183)-(564, 183), 62 nt = 194 ct = 32 ar = 0 DO WHILE nt < 637 PSET (nt, 266), ct PSET (nt, 267), ct PSET (nt, 268), ct PSET (nt, 269), ct PSET (nt, 270), ct nt = nt + 1 ar = ar + 1 IF ar = 7 THEN ar = 0 ct = ct + 1 END IF LOOP SLEEP (2) SCREEN _NEWIMAGE(840, 480, 256) main_color = 20 tool = 1 colorID = 1 size = 1 COLOR 15, 0 topmenu main_color, tool trap = 0 memX1 = 0 memY1 = 0 memX2 = 0 memY2 = 0 memC = 0 memCX = 0 memCY = 0 m2emC = 0 m2emCX = 0 m2emCY = 0 bdcolor = 0 debug = 1 IF debug = 1 THEN OPEN "qbPaintOut.txt" FOR OUTPUT AS #1 TextStart ("qbPaint 0.5 Auto Out") END IF DO DO WHILE _MOUSEINPUT mouseX = _MOUSEX mouseY = _MOUSEY colorID = colorID + _MOUSEWHEEL LOOP 'topbar LOCATE 1, 1 PRINT " x: " LOCATE 1, 4 PRINT mouseX LOCATE 1, 10 PRINT " y: " LOCATE 1, 13 PRINT mouseY LOCATE 1, 19 PRINT " color: " LOCATE 1, 26 PRINT colorID LOCATE 1, 32 PRINT " tool: " LOCATE 1, 38 PRINT tool LOCATE 1, 44 PRINT " size: " LOCATE 1, 50 PRINT size LOCATE 1, 98 PRINT " qbPaint" 'draw color block IF pastcolorID <> colorID THEN LINE (840, 480)-(800, 440), main_color, BF LINE (838, 478)-(802, 442), colorID, BF pastcolorID = colorID END IF 'call to paint IF _MOUSEBUTTON(1) OR _MOUSEBUTTON(2) OR _MOUSEBUTTON(3) THEN callPaint tool, mouseX, mouseY, colorID trap = 1 ELSE IF trap = 1 THEN trap = 0 'call to button callButton mouseX, mouseY 'recreate topmenu topmenu main_color, tool END IF END IF 'keys LET k$ = INKEY$ SELECT CASE k$ CASE "1" size = 1 CASE "2" size = 2 CASE "3" size = 3 CASE "`" 'recreate topmenu topmenu main_color, tool CASE "q" tool = 1 topmenu main_color, tool CASE "w" tool = 2 topmenu main_color, tool CASE "e" tool = 3 topmenu main_color, tool CASE "r" tool = 4 topmenu main_color, tool CASE "t" tool = 5 topmenu main_color, tool CASE "0" colorID = 0 topmenu main_color, tool CASE "s" save CASE "o" openfile CASE " " IF tool = 2 THEN DrawLine mouseX, mouseY, colorID END IF IF tool = 3 THEN DrawCube mouseX, mouseY, colorID, 1 END IF IF tool = 5 THEN DrawCircle mouseX, mouseY, colorID END IF CASE "/" IF tool = 3 THEN DrawCube mouseX, mouseY, colorID, 0 END IF END SELECT LOOP 'topmenu SUB topmenu (main_color, tool) 'Bar LINE (0, 0)-(40, 480), main_color, BF 'draw mega color block nt = 520 ct = 32 ar = 0 DO WHILE nt < 800 PSET (nt, 465), ct PSET (nt, 466), ct PSET (nt, 467), ct PSET (nt, 468), ct PSET (nt, 469), ct PSET (nt, 470), ct PSET (nt, 471), ct PSET (nt, 472), ct PSET (nt, 473), ct PSET (nt, 474), ct PSET (nt, 475), ct PSET (nt, 476), ct PSET (nt, 477), ct PSET (nt, 478), ct PSET (nt, 479), ct nt = nt + 1 ar = ar + 1 IF ar = 5 THEN ar = 0 ct = ct + 1 END IF LOOP 'Brush IF tool = 1 THEN LINE (2, 17)-(38, 53), 4, BF LINE (3, 18)-(37, 52), 15, BF ELSE LINE (2, 17)-(38, 53), 0, BF LINE (3, 18)-(37, 52), 7, BF END IF LINE (4, 27)-(12, 19), 0 LINE (12, 19)-(31, 38), 0 LINE (31, 38)-(31, 46), 0 LINE (31, 46)-(23, 46), 0 LINE (23, 46)-(4, 27), 0 LINE (31, 38)-(23, 46), 0 PAINT (20, 35), 14, 0 PAINT (29, 44), 6, 0 'Line IF tool = 2 THEN LINE (2, 17 + 39)-(38, 53 + 39), 4, BF LINE (3, 18 + 39)-(37, 52 + 39), 15, BF ELSE LINE (2, 17 + 39)-(38, 53 + 39), 0, BF LINE (3, 18 + 39)-(37, 52 + 39), 7, BF END IF LINE (6, 21 + 39)-(34, 49 + 39), 4 LINE (7, 21 + 39)-(35, 49 + 39), 4 LINE (5, 21 + 39)-(33, 49 + 39), 4 'Cube IF tool = 3 THEN LINE (2, 17 + 80)-(38, 53 + 80), 4, BF LINE (3, 18 + 80)-(37, 52 + 80), 15, BF ELSE LINE (2, 17 + 80)-(38, 53 + 80), 0, BF LINE (3, 18 + 80)-(37, 52 + 80), 7, BF END IF LINE (7, 25 + 80)-(33, 45 + 80), 4, BF LINE (8, 26 + 80)-(32, 44 + 80), 90, BF 'Fill IF tool = 4 THEN LINE (2, 17 + 121)-(38, 53 + 121), 4, BF LINE (3, 18 + 121)-(37, 52 + 121), 15, BF ELSE LINE (2, 17 + 121)-(38, 53 + 121), 0, BF LINE (3, 18 + 121)-(37, 52 + 121), 7, BF END IF LINE (7, 22 + 121)-(15, 19 + 121), 0 LINE (15, 19 + 121)-(23, 19 + 121), 0 LINE (23, 19 + 121)-(31, 22 + 121), 0 LINE (7, 22 + 121)-(15, 27 + 121), 0 LINE (15, 27 + 121)-(23, 27 + 121), 0 LINE (23, 27 + 121)-(31, 22 + 121), 0 LINE (7, 22 + 121)-(11, 46 + 121), 0 LINE (11, 46 + 121)-(27, 46 + 121), 0 LINE (27, 46 + 121)-(31, 22 + 121), 0 PAINT (20, 156), 26, 0 SHARED bdcolor PAINT (18, 143), bdcolor, 0 'Circle IF tool = 5 THEN LINE (2, 17 + 162)-(38, 53 + 162), 4, BF LINE (3, 18 + 162)-(37, 52 + 162), 15, BF ELSE LINE (2, 17 + 162)-(38, 53 + 162), 0, BF LINE (3, 18 + 162)-(37, 52 + 162), 7, BF END IF CIRCLE (19, 35 + 162), 13, 4 PAINT (19, 35 + 162), 90, 4 END SUB SUB callPaint (tool, mouseX, mouseY, colorID) SHARED size 'tools IF tool = 1 AND _MOUSEBUTTON(1) THEN ' Brush Brush mouseX, mouseY, colorID, size END IF IF tool = 2 THEN ' Line LineDraw mouseX, mouseY, colorID, size END IF IF tool = 3 THEN ' Cube CubeDraw mouseX, mouseY, colorID, size END IF IF tool = 4 THEN ' Fill DrawFill mouseX, mouseY, colorID END IF IF tool = 5 THEN ' Circle CircleDraw mouseX, mouseY, colorID, size END IF IF _MOUSEBUTTON(3) THEN 'Pipetka colorID = POINT(mouseX, mouseY) END IF END SUB SUB callButton (mouseX, mouseY) 'buttons SHARED tool IF mouseX > 3 AND mouseX < 37 AND mouseY > 18 AND mouseY < 52 THEN ' Brush tool = 1 END IF IF mouseX > 3 AND mouseX < 37 AND mouseY > 18 + 39 AND mouseY < 52 + 39 THEN ' Line tool = 2 END IF IF mouseX > 3 AND mouseX < 37 AND mouseY > 18 + 80 AND mouseY < 52 + 80 THEN ' Cube tool = 3 END IF IF mouseX > 3 AND mouseX < 37 AND mouseY > 18 + 121 AND mouseY < 52 + 121 THEN ' Fill tool = 4 END IF IF mouseX > 3 AND mouseX < 37 AND mouseY > 18 + 162 AND mouseY < 52 + 162 THEN ' Circle tool = 5 END IF END SUB SUB Brush (mouseX, mouseY, colorID, size) SHARED debug IF size = 1 THEN IF debug = 1 AND POINT(mouseX, mouseY) <> colorID THEN TextAutoOut ("PSET (" + STR$(mouseX) + "," + STR$(mouseY) + ")" + "," + STR$(colorID)) END IF PSET (mouseX, mouseY), colorID END IF IF size = 2 THEN IF debug = 1 THEN IF POINT(mouseX, mouseY) <> colorID THEN TextAutoOut ("PSET (" + STR$(mouseX) + "," + STR$(mouseY) + ")" + "," + STR$(colorID)) END IF IF POINT(mouseX + 1, mouseY) <> colorID THEN TextAutoOut ("PSET (" + STR$(mouseX + 1) + "," + STR$(mouseY) + ")" + "," + STR$(colorID)) END IF IF POINT(mouseX, mouseY + 1) <> colorID THEN TextAutoOut ("PSET (" + STR$(mouseX) + "," + STR$(mouseY + 1) + ")" + "," + STR$(colorID)) END IF IF POINT(mouseX + 1, mouseY + 1) <> colorID THEN TextAutoOut ("PSET (" + STR$(mouseX + 1) + "," + STR$(mouseY + 1) + ")" + "," + STR$(colorID)) END IF END IF PSET (mouseX, mouseY), colorID PSET (mouseX + 1, mouseY), colorID PSET (mouseX, mouseY + 1), colorID PSET (mouseX + 1, mouseY + 1), colorID END IF IF size = 3 THEN IF debug = 1 THEN IF POINT(mouseX, mouseY) <> colorID THEN TextAutoOut ("PSET (" + STR$(mouseX) + "," + STR$(mouseY) + ")" + "," + STR$(colorID)) END IF IF POINT(mouseX + 1, mouseY) <> colorID THEN TextAutoOut ("PSET (" + STR$(mouseX + 1) + "," + STR$(mouseY) + ")" + "," + STR$(colorID)) END IF IF POINT(mouseX, mouseY + 1) <> colorID THEN TextAutoOut ("PSET (" + STR$(mouseX) + "," + STR$(mouseY + 1) + ")" + "," + STR$(colorID)) END IF IF POINT(mouseX + 1, mouseY + 1) <> colorID THEN TextAutoOut ("PSET (" + STR$(mouseX + 1) + "," + STR$(mouseY + 1) + ")" + "," + STR$(colorID)) END IF IF POINT(mouseX + 2, mouseY) <> colorID THEN TextAutoOut ("PSET (" + STR$(mouseX + 2) + "," + STR$(mouseY) + ")" + "," + STR$(colorID)) END IF IF POINT(mouseX + 2, mouseY) <> colorID THEN TextAutoOut ("PSET (" + STR$(mouseX + 2) + "," + STR$(mouseY + 1) + ")" + "," + STR$(colorID)) END IF IF POINT(mouseX + 2, mouseY + 2) <> colorID THEN TextAutoOut ("PSET (" + STR$(mouseX + 2) + "," + STR$(mouseY + 2) + ")" + "," + STR$(colorID)) END IF IF POINT(mouseX + 1, mouseY + 2) <> colorID THEN TextAutoOut ("PSET (" + STR$(mouseX + 1) + "," + STR$(mouseY + 2) + ")" + "," + STR$(colorID)) END IF IF POINT(mouseX, mouseY + 2) <> colorID THEN TextAutoOut ("PSET (" + STR$(mouseX) + "," + STR$(mouseY + 2) + ")" + "," + STR$(colorID)) END IF END IF PSET (mouseX, mouseY), colorID PSET (mouseX + 1, mouseY), colorID PSET (mouseX, mouseY + 1), colorID PSET (mouseX + 1, mouseY + 1), colorID PSET (mouseX + 2, mouseY), colorID PSET (mouseX + 2, mouseY + 1), colorID PSET (mouseX + 2, mouseY + 2), colorID PSET (mouseX + 1, mouseY + 2), colorID PSET (mouseX, mouseY + 2), colorID END IF END SUB SUB LineDraw (mouseX, mouseY, colorID, size) SHARED memX1 SHARED memY1 SHARED memX2 SHARED memY2 IF _MOUSEBUTTON(1) THEN memX1 = mouseX memY1 = mouseY SupportDraw mouseX, mouseY END IF IF _MOUSEBUTTON(2) THEN memX2 = mouseX memY2 = mouseY SupportDraw2 mouseX, mouseY END IF END SUB SUB DrawLine (mouseX, mouseY, colorID) SHARED debug SHARED size SHARED memX1 SHARED memY1 SHARED memX2 SHARED memY2 IF size = 1 THEN IF debug = 1 THEN TextAutoOut ("LINE (" + STR$(memX1) + "," + STR$(memY1) + ") - (" + STR$(memX2) + "," + STR$(memY2) + "), " + STR$(colorID)) END IF LINE (memX1, memY1)-(memX2, memY2), colorID END IF IF size = 2 THEN IF debug = 1 THEN TextAutoOut ("LINE (" + STR$(memX1) + "," + STR$(memY1) + ") - (" + STR$(memX2) + "," + STR$(memY2) + "), " + STR$(colorID)) TextAutoOut ("LINE (" + STR$(memX1 + 1) + "," + STR$(memY1) + ") - (" + STR$(memX2 + 1) + "," + STR$(memY2) + "), " + STR$(colorID)) TextAutoOut ("LINE (" + STR$(memX1) + "," + STR$(memY1 + 1) + ") - (" + STR$(memX2) + "," + STR$(memY2 + 1) + "), " + STR$(colorID)) END IF LINE (memX1, memY1)-(memX2, memY2), colorID LINE (memX1 + 1, memY1)-(memX2 + 1, memY2), colorID LINE (memX1, memY1 + 1)-(memX2, memY2 + 1), colorID END IF IF size = 3 THEN IF debug = 1 THEN TextAutoOut ("LINE (" + STR$(memX1) + "," + STR$(memY1) + ") - (" + STR$(memX2) + "," + STR$(memY2) + "), " + STR$(colorID)) TextAutoOut ("LINE (" + STR$(memX1 + 1) + "," + STR$(memY1) + ") - (" + STR$(memX2 + 1) + "," + STR$(memY2) + "), " + STR$(colorID)) TextAutoOut ("LINE (" + STR$(memX1) + "," + STR$(memY1 + 1) + ") - (" + STR$(memX2) + "," + STR$(memY2 + 1) + "), " + STR$(colorID)) TextAutoOut ("LINE (" + STR$(memX1 + 2) + "," + STR$(memY1) + ") - (" + STR$(memX2 + 2) + "," + STR$(memY2) + "), " + STR$(colorID)) TextAutoOut ("LINE (" + STR$(memX1) + "," + STR$(memY1 + 2) + ") - (" + STR$(memX2) + "," + STR$(memY2 + 2) + "), " + STR$(colorID)) END IF LINE (memX1, memY1)-(memX2, memY2), colorID LINE (memX1 + 1, memY1)-(memX2 + 1, memY2), colorID LINE (memX1, memY1 + 1)-(memX2, memY2 + 1), colorID LINE (memX1 + 2, memY1)-(memX2 + 2, memY2), colorID LINE (memX1, memY1 + 2)-(memX2, memY2 + 2), colorID END IF END SUB SUB SupportDraw (mouseX, mouseY) SHARED memC SHARED memCX SHARED memCY PSET (memCX, memCY), memC memC = POINT(mouseX, mouseY) memCX = mouseX memCY = mouseY PSET (mouseX, mouseY), 4 END SUB SUB SupportDraw2 (mouseX, mouseY) SHARED m2emC SHARED m2emCX SHARED m2emCY PSET (m2emCX, m2emCY), m2emC m2emC = POINT(mouseX, mouseY) m2emCX = mouseX m2emCY = mouseY PSET (mouseX, mouseY), 2 END SUB SUB CubeDraw (mouseX, mouseY, colorID, size) SHARED memX1 SHARED memY1 SHARED memX2 SHARED memY2 IF _MOUSEBUTTON(1) THEN memX1 = mouseX memY1 = mouseY SupportDraw mouseX, mouseY END IF IF _MOUSEBUTTON(2) THEN memX2 = mouseX memY2 = mouseY SupportDraw2 mouseX, mouseY END IF END SUB SUB CircleDraw (mouseX, mouseY, colorID, size) SHARED memX1 SHARED memY1 SHARED memX2 SHARED memY2 IF _MOUSEBUTTON(1) THEN memX1 = mouseX memY1 = mouseY SupportDraw mouseX, mouseY END IF IF _MOUSEBUTTON(2) THEN memX2 = mouseX memY2 = mouseY SupportDraw2 mouseX, mouseY END IF END SUB SUB DrawCube (mouseX, mouseY, colorID, fill) SHARED debug SHARED size SHARED memX1 SHARED memY1 SHARED memX2 SHARED memY2 IF fill = 1 THEN IF debug = 1 THEN TextAutoOut ("LINE (" + STR$(memX1) + "," + STR$(memY1) + ") - (" + STR$(memX2) + "," + STR$(memY2) + "), " + STR$(colorID) + ", BF") END IF LINE (memX1, memY1)-(memX2, memY2), colorID, BF END IF IF fill = 0 THEN IF debug = 1 THEN TextAutoOut ("LINE (" + STR$(memX1) + "," + STR$(memY1) + ") - (" + STR$(memX2) + "," + STR$(memY2) + "), " + STR$(colorID) + ", B") END IF LINE (memX1, memY1)-(memX2, memY2), colorID, B END IF END SUB SUB DrawCircle (mouseX, mouseY, colorID) SHARED debug SHARED size SHARED memX1 SHARED memY1 SHARED memX2 SHARED memY2 d = SQR((memX2 - memX1) ^ 2 + (memY2 - memY1) ^ 2) IF debug = 1 THEN TextAutoOut ("CIRCLE (" + STR$(memX1) + "," + STR$(memY1) + "), " + STR$(d) + ", " + STR$(colorID)) END IF CIRCLE (memX1, memY1), d, colorID END SUB SUB DrawFill (mouseX, mouseY, colorID) SHARED debug SHARED bdcolor IF _MOUSEBUTTON(1) THEN IF debug = 1 AND POINT(mouseX, mouseY) <> colorID THEN TextAutoOut ("PAINT (" + STR$(mouseX) + "," + STR$(mouseY) + ")" + "," + STR$(colorID) + "," + STR$(bdcolor)) END IF PAINT (mouseX, mouseY), colorID, bdcolor END IF IF _MOUSEBUTTON(2) THEN bdcolor = POINT(mouseX, mouseY) END IF END SUB SUB TextAutoOut (text$) PRINT #1, text$ END SUB SUB TextStart (comment$) PRINT #1, "'", comment$ PRINT #1, "SCREEN _NEWIMAGE(840, 480, 256)" PRINT #1, "COLOR 15, 0" END SUB SUB save ' 41 16 OPEN "save.txt" FOR OUTPUT AS #2 sx = 41 sy = 16 ex = 840 ey = 480 nx = sx ny = sy LOCATE 1, 1 PRINT " " pic = 0 DO WHILE nx <> ex OR ny <> ey nx = sx DO WHILE nx <> ex pic = pic + 1 PRINT #2, STR$(nx) + " " + STR$(ny) + " " + STR$(POINT(nx, ny)) SupportDraw nx, ny nx = nx + 1 LOCATE 1, 1 PRINT "Save: " + STR$(INT(pic / 370736 * 100)) + "%" LOOP ny = ny + 1 LOOP CLOSE #2 END SUB SUB openfile IF _FILEEXISTS("save.txt") THEN OPEN "save.txt" FOR INPUT AS #3 lines = 0 LOCATE 1, 1 PRINT " " DO UNTIL EOF(3) LINE INPUT #3, s$ s$ = LTRIM$(s$) l$ = LEFT$(s$, INSTR(s$, " ") - 1) r$ = RIGHT$(s$, LEN(s$) - LEN(l$)) m$ = LEFT$(LTRIM$(r$), INSTR(LTRIM$(r$), " ") - 1) h$ = LTRIM$(RIGHT$(LTRIM$(r$), LEN(LTRIM$(r$)) - LEN(m$))) PSET (VAL(l$), VAL(m$)), VAL(h$) lines = lines + 1 LOCATE 1, 1 PRINT "Open: " + STR$(INT(lines / 370736 * 100)) + "%" LOOP PRINT #1, lines CLOSE #3 END IF END SUB