QB64.org Forum

Active Forums => Programs => Topic started by: carloscordeiro on September 26, 2020, 07:29:47 pm

Title: Line + Draw
Post by: carloscordeiro on September 26, 2020, 07:29:47 pm
Good night, Bplus
Me again here learning from you the instructions of Qbasic 64
This time I won't take your time too much.
I'm not used to code with graphics, I'm not familiar with graphics
The most I did was the boxes that I use in codes and that I want to use in the sequence code that you created for me.
Reading http://www.qb64.org/wiki/LINE I saw that the line is an excellent instruction for creating boxes.
The boxes that I create are with very obsolete instruction.
I managed to create a box with the line, but I wanted to make the lines a little thicker with the Draw statement.
As I mentioned, I have no knowledge of this instruction
I saw just one example of a slightly thick line that Draw created
Just below examples:
My obsolete boxes:

COLOR 11
LOCATE 1, 1: PRINT STRING$(80, CHR$(196)) 'box or frame
LOCATE 3, 1: PRINT STRING$(80, CHR$(196))
LOCATE 23, 1: PRINT STRING$(80, CHR$(196))
FOR R = 1 TO 23
    LOCATE R, 1: PRINT CHR$(179)
    LOCATE R, 80: PRINT CHR$(179)
NEXT R
LOCATE 3, 1: PRINT CHR$(195)
LOCATE 3, 80: PRINT CHR$(180)
LOCATE 1, 80: PRINT CHR$(191)
LOCATE 23, 80: PRINT CHR$(217)
LOCATE 23, 1: PRINT CHR$(192)
LOCATE 1, 1: PRINT CHR$(218)

Line instruction boxes: ‘Magnificent instruction
SCREEN 12
LINE (6, 5)-(632, 462), 11, B ' box or frame
'LINE (7, 6)-(631, 461), 11, B  'Slightly thicker lines
LINE (6, 5)-(632, 50), 11, B

Example I searched for at http://www.qb64.org/wiki/DRAW
SCREEN 12
PSET (20, 20), 12
DRAW "E2R30F2G2L30H2BR5P12,12" 'A little thick stroke

To summarize, I just want to make the box a little thicker.
I would like to know from you if there is this possibility.

Carlos
Title: Re: Line + Draw
Post by: bplus on September 26, 2020, 08:03:02 pm
When I was creating my current avatar I made a very nifty sub:

Code: QB64: [Select]
  1. SUB drawFrame (x, y, w, h, th, k AS _UNSIGNED LONG)
  2.     LINE (x, y)-STEP(w, th), k, BF 'two horizontal
  3.     LINE (x, y + h - th)-STEP(w, th), k, BF
  4.     LINE (x, y + th + 1)-STEP(th, h - 2 * th - 2), k, BF 'try not to overlap boxes in case k is transparent
  5.     LINE (x + w - th, y + th + 1)-STEP(th, h - 2 * th - 2), k, BF

This creates a box top left corner is x, y.
Width and height is w, h
Thickness of lines (really they are skinny filled boxes) = th
k is color and may work in screen 12

The modern way to setup your screen is with:
SCREEN _NEWIMAGE(MyScreenWidth, MyScreenHeight, 32)  ' < the 32 is for 32 bit colors = _RGB32(red, green, blue)

It (the frame SUB) is exactly what you could use.

Demo:
Code: QB64: [Select]
  1. SCREEN _NEWIMAGE(800, 600, 32)
  2. drawFrame 0, 0, 800, 600, 10, _RGB32(0, 0, 128)
  3. drawFrame 10, 10, 780, 50, 10, _RGB(255, 0, 0)
  4. drawFrame 10, 60, 780, 530, 10, _RGB32(200)
  5. drawFrame 10, 60, 260, 530, 10, _RGB32(255, 255, 0)
  6. drawFrame 270, 60, 260, 530, 10, _RGB32(0, 128, 0)
  7. drawFrame 530, 60, 260, 530, 10, _RGB32(240, 120, 0)
  8.  
  9. SUB drawFrame (x, y, w, h, th, k AS _UNSIGNED LONG)
  10.     LINE (x, y)-STEP(w, th), k, BF 'two horizontal
  11.     LINE (x, y + h - th)-STEP(w, th), k, BF
  12.     LINE (x, y + th + 1)-STEP(th, h - 2 * th - 2), k, BF 'try not to overlap boxes in case k is transparent
  13.     LINE (x + w - th, y + th + 1)-STEP(th, h - 2 * th - 2), k, BF
  14.  
  15.  
Title: Re: Line + Draw
Post by: bplus on September 26, 2020, 08:42:45 pm
Here's another way to draw thick lines
Code: QB64: [Select]
  1. 'update 2020-01-24 to include PD2 inside the sub
  2. SUB thic (x1, y1, x2, y2, thick, K AS _UNSIGNED LONG)
  3.     DIM PD2 AS DOUBLE, t2 AS SINGLE, a AS SINGLE, x3 AS SINGLE, y3 AS SINGLE, x4 AS SINGLE, y4 AS SINGLE
  4.     DIM x5 AS SINGLE, y5 AS SINGLE, x6 AS SINGLE, y6 AS SINGLE
  5.     PD2 = 1.570796326794897
  6.     t2 = thick / 2
  7.     IF t2 < 1 THEN t2 = 1
  8.     a = _ATAN2(y2 - y1, x2 - x1)
  9.     x3 = x1 + t2 * COS(a + PD2)
  10.     y3 = y1 + t2 * SIN(a + PD2)
  11.     x4 = x1 + t2 * COS(a - PD2)
  12.     y4 = y1 + t2 * SIN(a - PD2)
  13.     x5 = x2 + t2 * COS(a + PD2)
  14.     y5 = y2 + t2 * SIN(a + PD2)
  15.     x6 = x2 + t2 * COS(a - PD2)
  16.     y6 = y2 + t2 * SIN(a - PD2)
  17.     ftri x6, y6, x4, y4, x3, y3, K
  18.     ftri x3, y3, x5, y5, x6, y6, K
  19.  
  20. '2019-12-16 fix by Steve saves some time with STATIC and saves and restores last dest
  21. SUB ftri (x1, y1, x2, y2, x3, y3, K AS _UNSIGNED LONG)
  22.     DIM D AS LONG
  23.     STATIC a&
  24.     D = _DEST
  25.     IF a& = 0 THEN a& = _NEWIMAGE(1, 1, 32)
  26.     _DEST a&
  27.     _DONTBLEND a& '  '<<<< new 2019-12-16 fix
  28.     PSET (0, 0), K
  29.     _BLEND a& '<<<< new 2019-12-16 fix
  30.     _DEST D
  31.     _MAPTRIANGLE _SEAMLESS(0, 0)-(0, 0)-(0, 0), a& TO(x1, y1)-(x2, y2)-(x3, y3)
  32.  
  33.  
  34.  
Title: Re: Line + Draw
Post by: carloscordeiro on September 26, 2020, 08:49:21 pm
Bplus, it's like I said in the other posts, you make advanced codes. I wanted a code so I could choose the line thickness of the box. A very simple code.
It would be possible?
Carlos
Title: Re: Line + Draw
Post by: carloscordeiro on September 26, 2020, 08:55:43 pm
The latter does not appear the box on the screen
Title: Re: Line + Draw
Post by: OldMoses on September 26, 2020, 09:19:23 pm
You could run your line commands in a loop and just change its size to suit. Dead simple, unsophisticated, but if it works in your ap, go for it.

Code: QB64: [Select]
  1. thick = 5
  2. FOR x = 0 TO thick
  3.     LINE (6 + x, 5 + x)-(632 - x, 462 - x), 11, B ' box or frame
  4.     'LINE (7, 6)-(631, 461), 11, B  'Slightly thicker lines
  5.     LINE (6 + x, 5 + x)-(632 - x, 50 - x), 11, B
Title: Re: Line + Draw
Post by: carloscordeiro on September 26, 2020, 09:28:35 pm
Ok, great reasoning :)
I will do that.
thank you again

Carlos
Title: Re: Line + Draw
Post by: bplus on September 26, 2020, 09:31:26 pm
Here's a demo for thick

Code: QB64: [Select]
  1. SCREEN _NEWIMAGE(800, 600, 32)
  2. DEFINT A-Z
  3. 'try a box target in middle of screem
  4. FOR i = 1 TO 20
  5.     IF i MOD 3 = 1 THEN k = _RGB32(255)
  6.     IF i MOD 3 = 2 THEN k = _RGB32(200, 0, 0)
  7.     IF i MOD 3 = 0 THEN k = _RGB32(0, 0, 200)
  8.  
  9.     thic _WIDTH / 2 - i * 10 - 3, _HEIGHT / 2 - i * 10, _WIDTH / 2 + i * 10 + 3, _HEIGHT / 2 - i * 10, 6, k
  10.     thic _WIDTH / 2 - i * 10, _HEIGHT / 2 - i * 10, _WIDTH / 2 - i * 10, _HEIGHT / 2 + i * 10, 6, k
  11.     thic _WIDTH / 2 + i * 10, _HEIGHT / 2 - i * 10, _WIDTH / 2 + i * 10, _HEIGHT / 2 + i * 10, 6, k
  12.     thic _WIDTH / 2 - i * 10 - 3, _HEIGHT / 2 + i * 10, _WIDTH / 2 + i * 10 + 3, _HEIGHT / 2 + i * 10, 6, k
  13.  
  14.     _LIMIT 10
  15.  
  16.  
  17. 'update 2020-01-24 to include PD2 inside the sub
  18. SUB thic (x1, y1, x2, y2, thick, K AS _UNSIGNED LONG)
  19.     DIM PD2 AS DOUBLE, t2 AS SINGLE, a AS SINGLE, x3 AS SINGLE, y3 AS SINGLE, x4 AS SINGLE, y4 AS SINGLE
  20.     DIM x5 AS SINGLE, y5 AS SINGLE, x6 AS SINGLE, y6 AS SINGLE
  21.     PD2 = 1.570796326794897
  22.     t2 = thick / 2
  23.     IF t2 < 1 THEN t2 = 1
  24.     a = _ATAN2(y2 - y1, x2 - x1)
  25.     x3 = x1 + t2 * COS(a + PD2)
  26.     y3 = y1 + t2 * SIN(a + PD2)
  27.     x4 = x1 + t2 * COS(a - PD2)
  28.     y4 = y1 + t2 * SIN(a - PD2)
  29.     x5 = x2 + t2 * COS(a + PD2)
  30.     y5 = y2 + t2 * SIN(a + PD2)
  31.     x6 = x2 + t2 * COS(a - PD2)
  32.     y6 = y2 + t2 * SIN(a - PD2)
  33.     ftri x6, y6, x4, y4, x3, y3, K
  34.     ftri x3, y3, x5, y5, x6, y6, K
  35.  
  36. '2019-12-16 fix by Steve saves some time with STATIC and saves and restores last dest
  37. SUB ftri (x1, y1, x2, y2, x3, y3, K AS _UNSIGNED LONG)
  38.     DIM D AS LONG
  39.     STATIC a&
  40.     D = _DEST
  41.     IF a& = 0 THEN a& = _NEWIMAGE(1, 1, 32)
  42.     _DEST a&
  43.     _DONTBLEND a& '  '<<<< new 2019-12-16 fix
  44.     PSET (0, 0), K
  45.     _BLEND a& '<<<< new 2019-12-16 fix
  46.     _DEST D
  47.     _MAPTRIANGLE _SEAMLESS(0, 0)-(0, 0)-(0, 0), a& TO(x1, y1)-(x2, y2)-(x3, y3)
  48.  
  49.  
  50.  

Here is how to draw a simple line:
Code: QB64: [Select]
  1. line (x1, y1)-(x2, y2), Kolor

Here is how to draw a simple thick line:
Code: QB64: [Select]
  1. thic x1, y1, x2, y2, thickness, Kolor

Can't get simpler, where ever you want a line just use thic

Title: Re: Line + Draw
Post by: carloscordeiro on September 26, 2020, 09:40:23 pm
I wanted exactly that, but with few lines.
I will stay with your penultimate reasoning.

Code: QB64: [Select]
SCREEN 12
thick = 5
FOR x = 0 TO thick
    LINE (6 + x, 5 + x)-(632 - x, 462 - x), 11, B ' box or frame
    'LINE (7, 6)-(631, 461), 11, B  'Slightly thicker lines
    LINE (6 + x, 5 + x)-(632 - x, 50 - x), 11, B
NEXT x
Title: Re: Line + Draw
Post by: bplus on September 26, 2020, 09:47:40 pm
Here is simpler demo:

Code: QB64: [Select]
  1. SCREEN _NEWIMAGE(800, 600, 32)
  2. DEFINT A-Z
  3.     FOR i = 1 TO 20
  4.         thic RND * _WIDTH, RND * _HEIGHT, RND * _WIDTH, RND * _HEIGHT, RND * 30, _RGB32(RND * 255)
  5.         _LIMIT 10
  6.     NEXT
  7.     _DELAY .5
  8.     CLS
  9.  
  10. 'update 2020-01-24 to include PD2 inside the sub
  11. SUB thic (x1, y1, x2, y2, thick, K AS _UNSIGNED LONG)
  12.     DIM PD2 AS DOUBLE, t2 AS SINGLE, a AS SINGLE, x3 AS SINGLE, y3 AS SINGLE, x4 AS SINGLE, y4 AS SINGLE
  13.     DIM x5 AS SINGLE, y5 AS SINGLE, x6 AS SINGLE, y6 AS SINGLE
  14.     PD2 = 1.570796326794897
  15.     t2 = thick / 2
  16.     IF t2 < 1 THEN t2 = 1
  17.     a = _ATAN2(y2 - y1, x2 - x1)
  18.     x3 = x1 + t2 * COS(a + PD2)
  19.     y3 = y1 + t2 * SIN(a + PD2)
  20.     x4 = x1 + t2 * COS(a - PD2)
  21.     y4 = y1 + t2 * SIN(a - PD2)
  22.     x5 = x2 + t2 * COS(a + PD2)
  23.     y5 = y2 + t2 * SIN(a + PD2)
  24.     x6 = x2 + t2 * COS(a - PD2)
  25.     y6 = y2 + t2 * SIN(a - PD2)
  26.     ftri x6, y6, x4, y4, x3, y3, K
  27.     ftri x3, y3, x5, y5, x6, y6, K
  28.  
  29. '2019-12-16 fix by Steve saves some time with STATIC and saves and restores last dest
  30. SUB ftri (x1, y1, x2, y2, x3, y3, K AS _UNSIGNED LONG)
  31.     DIM D AS LONG
  32.     STATIC a&
  33.     D = _DEST
  34.     IF a& = 0 THEN a& = _NEWIMAGE(1, 1, 32)
  35.     _DEST a&
  36.     _DONTBLEND a& '  '<<<< new 2019-12-16 fix
  37.     PSET (0, 0), K
  38.     _BLEND a& '<<<< new 2019-12-16 fix
  39.     _DEST D
  40.     _MAPTRIANGLE _SEAMLESS(0, 0)-(0, 0)-(0, 0), a& TO(x1, y1)-(x2, y2)-(x3, y3)
  41.  

Just copy paste the 2 subs into your code and ignore them, all you need to know is

Code: QB64: [Select]
  1. thic x1, y1, x2, y2, thickness, Kolor

Draws a thick line with thickness of thickness and color of Kolor. It's one line of code to draw a thick line!



Title: Re: Line + Draw
Post by: carloscordeiro on September 26, 2020, 10:05:57 pm
You are very funny today, this is what I like about human beings. Witty.

Thanks Bplus for your reasoning of the loop, I will keep it, as it is the simplest and with few lines.

Thanks
Carlos
Title: Re: Line + Draw
Post by: FellippeHeitor on September 26, 2020, 11:03:13 pm
Here's sub box. Pass it the x, y coordinates and the width, height of the box, then the thickness and color to draw.

Code: QB64: [Select]
  1. SCREEN _NEWIMAGE(800, 600, 32)
  2.  
  3. box 0, 0, 200, 130, 10, _RGB32(183, 133, 33)
  4.  
  5. SUB box (x, y, w, h, thickness, theColor AS _UNSIGNED LONG)
  6.     LINE (x, y)-STEP(w, h), theColor, BF
  7.     LINE (x + thickness, y + thickness)-STEP(w - thickness * 2, h - thickness * 2), _BACKGROUNDCOLOR, BF
Title: Re: Line + Draw
Post by: bplus on September 26, 2020, 11:04:18 pm
You are very funny today, this is what I like about human beings. Witty.

Thanks Bplus for your reasoning of the loop, I will keep it, as it is the simplest and with few lines.

Thanks
Carlos

Well now hold on, Old Moses had a great idea too!

Here I added something to make it look like a frame to a picture!

Again just copy/paste the sub into the program, ignore how it works and enjoy the one line call

Code: QB64: [Select]
  1. framed2 x1, y1, x2, y2, thickness, kolor

x1, y1 has to top left corner of frame/box,  x2, y2 bottom right corner of frame or box, kolor best in mid range or more.

Code: QB64: [Select]
  1. SCREEN _NEWIMAGE(800, 600, 32)
  2.     FOR i = 1 TO 10
  3.         x1 = RND * _WIDTH: y1 = RND * _HEIGHT: x2 = RND * _WIDTH: y2 = RND * _HEIGHT
  4.         IF x1 > x2 THEN SWAP x1, x2: SWAP y1, y2
  5.         IF y1 > y2 THEN SWAP y1, y2
  6.         k = _RGB32(RND * 200 + 55, RND * 255, RND * 255)
  7.         framed2 x1, y1, x2, y2, RND * 15 + 2, k
  8.         LOCATE 1, 1: PRINT SPACE$(50)
  9.         LOCATE 1, 1: PRINT x1, y1, x2, y2
  10.         SLEEP
  11.     NEXT
  12.     _DELAY .5
  13.     CLS
  14.  
  15. SUB framed2 (x1, y1, x2, y2, thick, kolor AS _UNSIGNED LONG)
  16.     red = _RED32(kolor)
  17.     green = _GREEN32(kolor)
  18.     blue = _BLUE32(kolor)
  19.     FOR i = 0 TO thick
  20.         LINE (x1 + i, y1 + i)-(x2 - i, y2 - i), _RGB32(red - 10 * i, green - 10 * i, blue - 10 * i), B
  21.     NEXT
  22.  

Title: Re: Line + Draw
Post by: bplus on September 26, 2020, 11:40:33 pm
Yeah, I like Fellippe's width and height better as parameters x, y is top left corner and then width w to right and height h down:
Code: QB64: [Select]
  1. SCREEN _NEWIMAGE(800, 600, 32)
  2.     COLOR , _RGB32(255 * RND, 255 * RND, 100 * RND + 155)
  3.     CLS
  4.     FOR i = 1 TO 10
  5.         x1 = RND * (_WIDTH - 200) + 100: y1 = RND * (_HEIGHT - 200) + 100: w = 200 * RND + 35: h = RND * 200 + 35
  6.         framed3 x1, y1, w, h, RND * 20 + 4, _RGB32(170 * RND + 80, 255 * RND, 255 * RND)
  7.         LOCATE 1, 1: PRINT SPACE$(50)
  8.         LOCATE 1, 1: PRINT x1, y1, w, h
  9.         SLEEP
  10.     NEXT
  11.     _DELAY .5
  12.     CLS
  13.  
  14. SUB framed3 (x, y, w, h, thick, kolor AS _UNSIGNED LONG)
  15.     red = _RED32(kolor)
  16.     green = _GREEN32(kolor)
  17.     blue = _BLUE32(kolor)
  18.     FOR i = 0 TO thick
  19.         LINE (x + i, y + i)-(x + w - i, y + h - i), _RGB32(red - 10 * i, green - 10 * i, blue - 10 * i), B
  20.     NEXT
  21.  

 


Again to use copy/paste sub into program and call with:
Code: QB64: [Select]
  1. framed3 x, y, w, h, thick, Kolor
Title: Re: Line + Draw
Post by: bplus on September 27, 2020, 02:36:14 pm
Another 3D version of frame probably best yet:
Code: QB64: [Select]
  1. SCREEN _NEWIMAGE(800, 600, 32)
  2.     COLOR , _RGB32(128 + RND * 128 - 64)
  3.     CLS
  4.     FOR i = 1 TO 10
  5.         x1 = RND * (_WIDTH - 200) + 100: y1 = RND * (_HEIGHT - 200) + 100: w = 200 * RND + 35: h = RND * 200 + 35
  6.         framed4 x1, y1, w, h, RND * 10 + 4, _RGB32(128 + RND * 128 - 64, 128 + RND * 128 - 64, 128 + RND * 128 - 64)
  7.         LOCATE 1, 1: PRINT SPACE$(50)
  8.         LOCATE 1, 1: PRINT x1, y1, w, h
  9.         SLEEP
  10.     NEXT
  11.     _DELAY .5
  12.     CLS
  13.  
  14. SUB framed4 (x, y, w, h, thick, kolor AS _UNSIGNED LONG)
  15.     red = _RED32(kolor)
  16.     green = _GREEN32(kolor)
  17.     blue = _BLUE32(kolor)
  18.     DIM saveC AS _UNSIGNED LONG
  19.     FOR i = 0 TO thick * .5
  20.         red = red + 15: green = green + 15: blue = blue + 15
  21.         LINE (x + i, y + i)-(x + w - i, y + h - i), _RGB32(red, green, blue), B
  22.     NEXT
  23.     FOR i = thick * .5 TO thick
  24.         red = red - 15: green = green - 15: blue = blue - 15
  25.         LINE (x + i, y + i)-(x + w - i, y + h - i), _RGB32(red, green, blue), B
  26.     NEXT
  27.  

  [ This attachment cannot be displayed inline in 'Print Page' view ]  
Title: Re: Line + Draw
Post by: Unseen Machine on September 27, 2020, 02:56:24 pm
Hmmmm....looks a lot like my VQB_Frame command!

Code: QB64: [Select]
  1. SUB VQB_Frame (X%, Y%, Width%, Height%, CLR&)
  2. OldCLR& = CLR&
  3. LINE (X%, Y%)-(X% + Width%, Y% + Height%), CLR&, BF
  4. FOR Border% = 0 TO 4
  5.   IF CLR& > _RGB(0, 0, 0) THEN
  6.     NewRed& = _RED(CLR&) - (6 * Border%)
  7.     NewGreen& = _GREEN(CLR&) - (6 * Border%)
  8.     NewBlue& = _BLUE(CLR&) - (6 * Border%)
  9.     CLR& = _RGB(NewRed&, NewGreen&, NewBlue&)
  10.   ELSE
  11.     NewRed& = _RED(CLR&) + (6 * Border%)
  12.     NewGreen& = _GREEN(CLR&) + (6 * Border%)
  13.     NewBlue& = _BLUE(CLR&) + (6 * Border%)
  14.     CLR& = _RGBA(NewRed&, NewGreen&, NewBlue&, 120)
  15.   END IF
  16.   LINE (X% - Border%, Y% - Border%)-(X% + Width% + Border%, Y% - Border%), CLR&, BF
  17.   LINE (X% - Border%, Y% + Height% + Border%)-(X% + Width% + Border%, Y% + Height% + Border%), CLR&, BF
  18.   LINE (X% - Border%, Y% - Border%)-(X% - Border%, Y% + Height% + Border%), CLR&, BF
  19.   LINE (X% + Width% + Border%, Y% - Border%)-(X% + Width% + Border%, Y% + Height% + Border%), CLR&, BF
  20. CLR& = OldCLR&

I found this on my dropbox the other day, the code is ten years old but should still be good for shapes and lines etc...

Code: QB64: [Select]
  1. SUB GDK_Triangle (x1%, y1%, x2%, y2%, x3%, y3%, CLR&)
  2. LINE (x1%, y1%)-(x2%, y2%), CLR&
  3. LINE (x1%, y1%)-(x3%, y3%), CLR&
  4. LINE (x2%, y2%)-(x3%, y3%), CLR&
  5.  
  6.  
  7. SUB GDK_TriangleFill (x1%, y1%, x2%, y2%, x3%, y3%, CLR&, FillCLR&)
  8. LINE (x1%, y1%)-(x2%, y2%), CLR&
  9. LINE (x1%, y1%)-(x3%, y3%), CLR&
  10. LINE (x2%, y2%)-(x3%, y3%), CLR&
  11. paintx% = (x1% + x2% + x3%) / 3
  12. painty% = (y1% + y2% + y3%) / 3
  13. PAINT (paintx%, painty%), FillCLR&, CLR&
  14.  
  15.  
  16. SUB GDK_Ellipse (X%, Y%, XRadius!, YRadius!, CLR&)
  17. IF XRadius! > YRadius! THEN Radius! = XRadius! ELSE Radius! = YRadius!
  18. MinStep! = 1 / (2 * 3.1415926535 * Radius!)
  19. FOR i = 0 TO 8 * ATN(1) STEP MinStep!
  20.   pointx% = X% + (XRadius! * COS(i))
  21.   pointy% = Y% + (YRadius! * SIN(i))
  22.   PSET (pointx%, pointy%), CLR&
  23.  
  24.  
  25. SUB GDK_EllipseFill (X%, Y%, XRadius!, YRadius!, CLR&, FillCLR&)
  26. IF XRadius! > YRadius! THEN Radius! = XRadius! ELSE Radius! = YRadius!
  27. MinStep! = 1 / (2 * 3.1415926535 * Radius!)
  28. FOR i = 0 TO 8 * ATN(1) STEP MinStep!
  29.   pointx% = X% + (XRadius! * COS(i))
  30.   pointy% = Y% + (YRadius! * SIN(i))
  31.   PSET (pointx%, pointy%), CLR&
  32. PAINT (X%, Y%), FillCLR&, CLR&
  33.  
  34.  
  35. SUB GDK_EllipseSegment (X%, Y%, XRadius!, YRadius!, Start!, End!, CLR&)
  36. Firstloop% = 0
  37. IF XRadius! > YRadius! THEN Radius! = XRadius! ELSE Radius! = YRadius!
  38. MinStep! = 1 / (2 * 3.1415926535 * Radius!)
  39. FOR i = Start! TO End! STEP MinStep!
  40.   pointx% = X% + (XRadius! * COS(i))
  41.   pointy% = Y% + (YRadius! * SIN(i))
  42.   IF Firstloop% = 0 THEN
  43.     LINE (X%, Y%)-(pointx%, pointy%), CLR&
  44.     Firstloop% = 1
  45.   END IF
  46.   PSET (pointx%, pointy%), CLR&
  47. LINE (X%, Y%)-(pointx%, pointy%), CLR&
  48.  
  49.  
  50. SUB GDK_EllipseSegmentFill (X%, Y%, XRadius!, YRadius!, Start!, End!, CLR&, FillClr&)
  51. Firstloop% = 0
  52. DIM Firstloopxy(2) AS INTEGER
  53. IF XRadius! > YRadius! THEN Radius! = XRadius! ELSE Radius! = YRadius!
  54. MinStep! = 1 / (2 * 3.1415926535 * Radius!)
  55. FOR i = Start! TO End! STEP MinStep!
  56.   pointx% = X% + (XRadius! * COS(i))
  57.   pointy% = Y% + (YRadius! * SIN(i))
  58.   IF Firstloop% = 0 THEN
  59.     Firstloopxy(0) = pointx%
  60.     Firstloopxy(1) = pointy%
  61.     LINE (X%, Y%)-(pointx%, pointy%), CLR&
  62.     Firstloop% = 1
  63.   END IF
  64.   PSET (pointx%, pointy%), CLR&
  65. LINE (X%, Y%)-(pointx%, pointy%), CLR&
  66. IF End! - Start! > 4 * ATN(1) THEN
  67.   i = (End! / 4)
  68.   pointx% = X% + (XRadius! * COS(i))
  69.   pointy% = Y% + (YRadius! * SIN(i))
  70. paintx% = (X% + Firstloopxy(0) + pointx%) / 3
  71. painty% = (Y% + Firstloopxy(1) + pointy%) / 3
  72. PAINT (paintx%, painty%), FillClr&, CLR&
  73.  
  74.  
  75. SUB GDK_Circle (X%, Y%, Radius!, CLR&)
  76. MinStep! = 1 / (2 * 3.1415926535 * Radius!)
  77. FOR i = 0 TO 8 * ATN(1) STEP MinStep!
  78.   pointx% = X% + (Radius! * COS(i))
  79.   pointy% = Y% + (Radius! * SIN(i))
  80.   PSET (pointx%, pointy%), CLR&
  81.  
  82.  
  83. SUB GDK_CircleFill (X%, Y%, Radius!, CLR&, FillCLR&)
  84. MinStep! = 1 / (2 * 3.1415926535 * Radius!)
  85. FOR i = 0 TO 8 * ATN(1) STEP MinStep!
  86.   pointx% = X% + (Radius! * COS(i))
  87.   pointy% = Y% + (Radius! * SIN(i))
  88.   PSET (pointx%, pointy%), CLR&
  89. PAINT (X%, Y%), FillCLR&, CLR&
  90.  
  91.  
  92. SUB GDK_CircleSegment (X%, Y%, Radius!, CLR&, CircleStart!, CircleEnd!)
  93. Firstloop% = 0
  94. MinStep! = 1 / (2 * 3.1415926535 * Radius!)
  95. FOR i = CircleStart! TO CircleEnd! STEP MinStep!
  96.   pointx% = X% + (Radius! * COS(i))
  97.   pointy% = Y% + (Radius! * SIN(i))
  98.   IF Firstloop% = 0 THEN
  99.     LINE (X%, Y%)-(pointx%, pointy%), CLR&
  100.     Firstloop% = 1
  101.   END IF
  102.   PSET (pointx%, pointy%), CLR&
  103. LINE (X%, Y%)-(pointx%, pointy%), CLR&
  104.  
  105.  
  106. SUB GDK_CircleSegmentFill (X%, Y%, Radius!, CLR&, FillClr&, CircleStart!, CircleEnd!)
  107. Firstloop% = 0
  108. DIM Firstloopxy(2) AS INTEGER
  109. MinStep! = 1 / (2 * 3.1415926535 * Radius!)
  110. FOR i = CircleStart! TO CircleEnd! STEP MinStep!
  111.   pointx% = X% + (Radius! * COS(i))
  112.   pointy% = Y% + (Radius! * SIN(i))
  113.   IF Firstloop% = 0 THEN
  114.     LINE (X%, Y%)-(pointx%, pointy%), CLR&
  115.     Firstloopxy(0) = pointx%
  116.     Firstloopxy(1) = pointy%
  117.     Firstloop% = 1
  118.   END IF
  119.   PSET (pointx%, pointy%), CLR&
  120. LINE (X%, Y%)-(pointx%, pointy%), CLR&
  121. IF CircleEnd! - CircleStart! > 4 * ATN(1) THEN
  122.   i = (CircleEnd! / 4)
  123.   pointx% = X% + (Radius! * COS(i))
  124.   pointy% = Y% + (Radius! * SIN(i))
  125. paintx% = (X% + Firstloopxy(0) + pointx%) / 3
  126. painty% = (Y% + Firstloopxy(1) + pointy%) / 3
  127. PAINT (paintx%, painty%), FillClr&, CLR&
  128.  
  129.  
  130. SUB GDK_Line (X%, Y%, XX%, YY%, CLR&, WIDTH%)
  131. IF WIDTH% MOD 2 = 0 THEN
  132.   FOR offset = -(WIDTH% / 2) TO WIDTH% / 2
  133.     LINE (X%, Y% + offset)-(XX%, YY% + offset), CLR&
  134.   NEXT
  135.   FOR offset = -((WIDTH% + 1) / 2) TO (WIDTH% + 1) / 2
  136.     LINE (X%, Y% + offset)-(XX%, YY% + offset), CLR&
  137.   NEXT
  138.  
  139.  
  140. SUB GDK_LineAngle (X%, Y%, Angle!, Length!, CLR&)
  141. x2% = X% + (Length! * COS(Angle!))
  142. y2% = Y% + (Length! * SIN(Angle!))
  143. LINE (X%, Y%)-(x2%, y2%), CLR&
  144.  
  145.  
  146. SUB GDK_LineH (X%, XX%, Y%, CLR&, WIDTH%)
  147. IF WIDTH% MOD 2 = 0 THEN
  148.   FOR offset = -(WIDTH% / 2) TO WIDTH% / 2
  149.     LINE (X%, Y% + offset)-(XX%, Y% + offset), CLR&
  150.   NEXT
  151.   FOR offset = -((WIDTH% + 1) / 2) TO (WIDTH% - 1) / 2
  152.     LINE (X%, Y% + offset)-(XX%, Y% + offset), CLR&
  153.   NEXT
  154.  
  155.  
  156. SUB GDK_LineV (Y%, YY%, X%, CLR&, WIDTH%)
  157. IF WIDTH% MOD 2 = 0 THEN
  158.   FOR offset = -(WIDTH% / 2) TO WIDTH% / 2
  159.     LINE (X% + offset, Y%)-(X% + offset, YY%), CLR&
  160.   NEXT
  161.   FOR offset = -((WIDTH% + 1) / 2) TO (WIDTH% - 1) / 2
  162.     LINE (X% + offset, Y%)-(X% + offset, YY%), CLR&
  163.   NEXT
  164.  
  165.  
  166. SUB GDK_Box (X%, Y%, Width%, Height%, CLR&)
  167. LINE (X%, Y%)-(X% + Width%, Y% + Height%), CLR&, B
  168.  
  169.  
  170. SUB GDK_BoxFill (X%, Y%, Width%, Height%, CLR&, FillCLR&)
  171. LINE (X%, Y%)-(X% + Width%, Y% + Height%), CLR&, B
  172. PAINT (X% + 2, Y% + 2), FillCLR&, CLR&
  173.  
  174.  
  175. SUB GDK_BoxXS (X%, Y%, Width%, Height%, XWidth%, CLR&, ShadeClr&)
  176. Oldclr& = CLR&
  177. FOR j% = 0 TO XWidth% - 1
  178.   IF _RED(CLR&) <= 255 AND _RED(ShadeClr&) > 0 THEN newred& = _RED(CLR&) - _RED(ShadeClr&)
  179.   IF _BLUE(CLR&) <= 255 AND _BLUE(ShadeClr&) > 0 THEN newblue& = _BLUE(CLR&) - _BLUE(ShadeClr&)
  180.   IF _GREEN(CLR&) <= 255 AND _GREEN(ShadeClr&) > 0 THEN newgreen& = _GREEN(CLR&) - _GREEN(ShadeClr&)
  181.   CLR& = _RGB(newred&, newgreen&, newblue&)
  182.   LINE (X% - j%, Y% - j%)-(X% + Width% + j%, Y% + Height% + j%), CLR&, B
  183. CLR& = Oldclr&
  184.  
  185.  
  186. SUB GDK_EllipseXS (X%, Y%, XRadius!, YRadius!, CLR&, Width%, ShadeClr&)
  187. FOR j% = 0 TO Width% - 1
  188.   IF _RED(CLR&) <= 255 AND _RED(ShadeClr&) > 0 THEN newred& = _RED(CLR&) - _RED(ShadeClr&)
  189.   IF _BLUE(CLR&) <= 255 AND _BLUE(ShadeClr&) > 0 THEN newblue& = _BLUE(CLR&) - _BLUE(ShadeClr&)
  190.   IF _GREEN(CLR&) <= 255 AND _GREEN(ShadeClr&) > 0 THEN newgreen& = _GREEN(CLR&) - _GREEN(ShadeClr&)
  191.   CLR& = _RGB(newred&, newgreen&, newblue&)
  192.   IF XRadius! > YRadius! THEN Radius! = XRadius! ELSE Radius! = YRadius!
  193.   MinStep! = 1 / (2 * 3.1415926535 * Radius!)
  194.   FOR i = 0 TO 8 * ATN(1) STEP MinStep!
  195.     pointx% = X% + (XRadius! * COS(i))
  196.     pointy% = Y% + (YRadius! * SIN(i))
  197.     PSET (pointx%, pointy%), CLR&
  198.   NEXT
  199.   XRadius! = XRadius! + 1
  200.   YRadius! = YRadius! + 1
  201.  
  202.  
  203. SUB GDK_CircleXS (X%, Y%, Radius!, CLR&, Width%, ShadeClr&)
  204. OldClr& = CLR&
  205. FOR j% = 0 TO Width% - 1
  206.   IF _RED(ShadeClr&) > 0 THEN newred& = _RED(CLR&) - _RED(ShadeClr&)
  207.   IF _BLUE(ShadeClr&) > 0 THEN newblue& = _BLUE(CLR&) - _BLUE(ShadeClr&)
  208.   IF _GREEN(ShadeClr&) > 0 THEN newgreen& = _GREEN(CLR&) - _GREEN(ShadeClr&)
  209.   CLR& = _RGB(newred&, newgreen&, newblue&)
  210.   MinStep! = 1 / (2 * 3.1415926535 * Radius!)
  211.   FOR i = 0 TO 8 * ATN(1) STEP MinStep!
  212.     pointx% = X% + (Radius! * COS(i))
  213.     pointy% = Y% + (Radius! * SIN(i))
  214.     PSET (pointx%, pointy%), CLR&
  215.   NEXT
  216.   Radius! = Radius! + 1
  217. CLR& = OldClr&
  218.  
  219.  
  220. SUB GDK_EllipseX (X%, Y%, XRadius!, YRadius!, CLR&, Width%)
  221. FOR j% = 0 TO Width% - 1
  222.   IF XRadius! > YRadius! THEN Radius! = XRadius! ELSE Radius! = YRadius!
  223.   MinStep! = 1 / (2 * 3.1415926535 * Radius!)
  224.   FOR i = 0 TO 8 * ATN(1) STEP MinStep!
  225.     pointx% = X% + (XRadius! * COS(i))
  226.     pointy% = Y% + (YRadius! * SIN(i))
  227.     PSET (pointx%, pointy%), CLR&
  228.   NEXT
  229.   XRadius! = XRadius! + 1
  230.   YRadius! = YRadius! + 1
  231.  
  232.  
  233. SUB GDK_CircleX (X%, Y%, Radius!, CLR&, Width%)
  234. MinStep! = 1 / (2 * 3.1415926535 * Radius!)
  235. FOR j% = 0 TO Width% - 1
  236.   FOR i = 0 TO 8 * ATN(1) STEP MinStep!
  237.     pointx% = X% + (Radius! * COS(i))
  238.     pointy% = Y% + (Radius! * SIN(i))
  239.     PSET (pointx%, pointy%), CLR&
  240.   NEXT
  241.   Radius! = Radius! + 1
  242.  

Unseen
Title: Re: Line + Draw
Post by: OldMoses on September 27, 2020, 04:12:57 pm
I did something very similar to Fellippe's "box" subroutine for making buttons in my star system simulator. SierraKen's calculator buttons inspired me to add a "beveling" SUB to add some 3D pop to them, also similar to the frame examples above. I also made it so that the button label would show any associated hotkeys in a highlight color. Easy to change the position & parameters of the buttons.

All that's required is to call:
Con_Blok x position, y position, width, height, button label, hotkey position, button color

Code: QB64: [Select]
  1. A& = _NEWIMAGE(600, 400, 32)
  2. 'DIM SHARED f&
  3. 'f& = _LOADFONT("c:\windows\fonts\arialbd.ttf", 16, "monospace")
  4. Con_Blok 50, 50, 80, 48, "Sit", 1, &HFF00FF00
  5. Con_Blok 150, 50, 80, 48, "Stay", 2, &HFF0000FF
  6. Con_Blok 300, 150, 80, 48, "Fetch", 1, &HFF04500FF
  7. Con_Blok 500, 320, 80, 48, "Roll", 1, &HFFFF00FF
  8.  
  9.  
  10.  
  11. SUB Con_Blok (xpos AS INTEGER, ypos AS INTEGER, xsiz AS INTEGER, ysiz AS INTEGER, label AS STRING, high AS INTEGER, col AS _UNSIGNED LONG)
  12.  
  13.     'Create control block
  14.     CN& = _NEWIMAGE(xsiz, ysiz, 32)
  15.     _DEST CN&
  16.     COLOR , col
  17.     CLS
  18.     BevelB xsiz, ysiz, col
  19.     x = LEN(label)
  20.     IF f& > 0 THEN '                                            if font is available
  21.         sx = (xsiz / 2) - (x * _FONTWIDTH(f&)) / 3
  22.         sy = ysiz / 2 - 6
  23.         _FONT f&
  24.     ELSE '                                                      if not
  25.         sx = xsiz / 2 - x * 4: sy = ysiz / 2 - 8
  26.     END IF
  27.     FOR p = 1 TO x '                                            iterate through label characters
  28.         IF p = high THEN '                                      print hotkey highlight color (red) else (black)
  29.             COLOR &HFFFF0000
  30.         ELSE
  31.             COLOR &HFF000000
  32.         END IF
  33.         IF col = &HFFC80000 THEN COLOR 15
  34.         _PRINTSTRING (sx + (p - 1) * 8, sy), MID$(label, p, 1)
  35.     NEXT p
  36.     _FONT 16
  37.     _PUTIMAGE (xpos, ypos), CN&, A&
  38.     _FREEIMAGE CN&
  39.  
  40. END SUB 'Con_Blok
  41.  
  42. SUB BevelB (xsiz AS INTEGER, ysiz AS INTEGER, col AS _UNSIGNED LONG)
  43.  
  44.     'Create control button bevels for 3D effect - called from Con_Blok
  45.     'Inspiration and basic algorithm by SierraKen
  46.     SELECT CASE ysiz
  47.         CASE IS <= xsiz
  48.             brdr = INT(ysiz / 4)
  49.         CASE IS > xsiz
  50.             brdr = INT(xsiz / 4)
  51.     END SELECT
  52.     FOR bb = 0 TO brdr
  53.         c = c + 100 / brdr
  54.         LINE (0 + bb, 0 + bb)-(xsiz - 1 - bb, ysiz - 1 - bb), _RGBA32(_RED32(col) - 100 + c, _GREEN32(col) - 100 + c, _BLUE32(col) - 100 + c, _ALPHA(col)), B
  55.     NEXT bb
  56.  
  57. END SUB 'BevelB
  58.  
Title: Re: Line + Draw
Post by: bplus on September 27, 2020, 04:22:19 pm
@Unseen Machine  yeah, yours look like 3D pads sticking up from a surface. You might like the fill triangle I used for thic line, no PAINT so no possible interference by other objects.

@OldMoses yeah I like those buttons too.
Title: Re: Line + Draw
Post by: bplus on September 27, 2020, 04:48:34 pm
@carloscordeiro

Seeing as you've just begun using graphics screens you might like the QB4.5 colors used in SCREEN 12 converted to _RGB32() colors for your custom designed screen made with _NEWIMAGE

You can tinker with the numbers but I use an qb~& FUNCTION for 0-15 colors converted to 32 bit EGB
Code: QB64: [Select]
  1.     SELECT CASE n
  2.         CASE 0: qb~& = &HFF000000
  3.         CASE 1: qb~& = &HFF000088
  4.         CASE 2: qb~& = &HFF008800
  5.         CASE 3: qb~& = &HFF008888
  6.         CASE 4: qb~& = &HFF880000
  7.         CASE 5: qb~& = &HFF880088
  8.         CASE 6: qb~& = &HFF888800
  9.         CASE 7: qb~& = &HFFCCCCCC
  10.         CASE 8: qb~& = &HFF888888
  11.         CASE 9: qb~& = &HFF0000FF
  12.         CASE 10: qb~& = &HFF00FF00
  13.         CASE 11: qb~& = &HFF00FFFF
  14.         CASE 12: qb~& = &HFFFF0000
  15.         CASE 13: qb~& = &HFFFF00FF
  16.         CASE 14: qb~& = &HFFFFFF00
  17.         CASE 15: qb~& = &HFFFFFFFF
  18.     END SELECT
  19.  

If I want red 12, I use qb~&(12), blue qb~&(9)....

the ~& are the suffix to _UNSIGNED LONG the best type to use for 32 bit colors.

So to PRINT s$ in red on black:
COLOR qb~&(12), qb~&(0)
PRINT s$

What is also cool is you can adjust the colors to your liking! So you can get a real orange and green.
Title: Re: Line + Draw
Post by: carloscordeiro on September 27, 2020, 05:56:39 pm
I will keep the two simpler ones for the box I want.

OldMoses:

Code: QB64: [Select]
SCREEN 12
thick = 5
FOR x = 0 TO thick
    LINE (6 + x, 5 + x)-(632 - x, 462 - x), 11, B ' box or frame
    'LINE (7, 6)-(631, 461), 11, B  'Slightly thicker lines
    LINE (6 + x, 5 + x)-(632 - x, 50 - x), 11, B
NEXT x

And Felipe:

Código: QB64 : [Selecionar]
TELA _NOVAIMAGEM ( 800 , 600 , 32 )
caixa 0 , 0 , 200 , 130 , 10 , _RGB32 ( 183 , 133 , 33 )
SUB box ( x , y , w , h , espessura , a cor AS _UNSIGNED LONG )
    LINE ( x , y ) - STEP ( w , h ) , theColor , BF
    LINHA ( x + espessura , y + espessura ) - PASSO ( w - espessura * 2 , h - espessura * 2 ) , _BACKGROUNDCOLOR , BF
END SUB

Felipe's line code is great.
Simple and with few lines.

Thank you all

Carlos
Title: Re: Line + Draw
Post by: TempodiBasic on September 27, 2020, 06:07:40 pm
Hi
I must admit that all you guys are very active and have so fantastic ideas to develope the request of  carloscordeiro!
I find very interesting your solutions, only Bplus have posted nothing!
However I post my raw two cents :
Code: QB64: [Select]
  1. SCREEN _NEWIMAGE(800, 600, 32)
  2. Makeframe 100, 300, 500, 350, 5, _RGB32(255, 0, 0)
  3. Makeframe 70, 400, 700, 10, 5, _RGB32(0, 150, 0)
  4. Makeframe 150, 400, 170, 10, 5, _RGB32(50, 50, 50)
  5. MakeLine 10, 300, 700, 400, 5, _RGB32(10, 100, 255)
  6. MakeLine 100, 200, 500, 400, 4, _RGB32(100, 10, 55)
  7.  
  8. SUB Makeframe (xStart, yStart, xEnd, yEnd, Thik, C AS _UNSIGNED LONG)
  9.     IF xStart > xEnd THEN SWAP xStart, xEnd
  10.     IF yStart > yEnd THEN SWAP yStart, yEnd
  11.     LINE (xStart, yStart)-(xEnd, yEnd), C, B
  12.     LINE (xStart + Thik, yStart + Thik)-(xEnd - Thik, yEnd - Thik), C, B
  13.     PAINT (xStart + INT(Thik / 2), yStart + INT(Thik / 2)), C, POINT(xStart, yStart)
  14.  
  15. SUB MakeLine (xStart, yStart, xEnd, yEnd, Thik, C AS _UNSIGNED LONG)
  16.     LINE (xStart, yStart)-(xEnd, yEnd), C
  17.     LINE (xStart, yStart + Thik)-(xEnd, yEnd + Thik), C
  18.     LINE (xStart, yStart)-(xStart, yStart + Thik), C
  19.     LINE (xEnd, yEnd)-(xEnd, yEnd + Thik), C
  20.     PAINT (xStart + INT(Thik / 2), yStart + INT(Thik / 2)), C, POINT(xStart, yStart)
  21.  
  22. SUB grid (xMin, yMin, xMax, yMax, xDelta, yDelta, C AS _UNSIGNED LONG)
  23.     'this sub creates a costumizable grid on the screen
  24.     FOR a = xMin TO xMax STEP xDelta
  25.         LINE (a, yMin)-(a, yMax), C
  26.     NEXT
  27.     FOR a = yMin TO yMax STEP yDelta
  28.         LINE (xMin, a)-(xMax, a), C
  29.     NEXT

@carloscordeiro
I must point out that with Draw you can increase only one dimension of the line that you draw...
see here this code show this concept.
Code: QB64: [Select]
  1. SCREEN _NEWIMAGE(800, 600, 32)
  2. grid 1, 800, 10, 1, 600, 5, _RGB32(0, 155, 0)
  3. LINE (100, 100)-(500, 100), _RGB32(255, 0, 0)
  4. DRAW "s16bm100,200m500,200"
  5. DRAW "s16bm100,300r100" ' the effect is on the direction of movement s4 = 1 pixel
  6. DRAW "s32bm100,350r50" ' s8= 2 pixels, s16 = 4 pixels, s32 = 8 pixels
  7. LINE (100, 400)-(500, 400), _RGB32(255, 0, 0)
  8.  
  9. SUB grid (xMin, yMin, xMax, yMax, xDelta, yDelta, C AS _UNSIGNED LONG)
  10.     'this sub creates a costumizable grid on the screen
  11.     FOR a = xMin TO xMax STEP xDelta
  12.         LINE (a, yMin)-(a, yMax), C
  13.     NEXT
  14.     FOR a = yMin TO yMax STEP yDelta
  15.         LINE (xMin, a)-(xMax, a), C
  16.     NEXT

Thanks to read
Title: Re: Line + Draw
Post by: carloscordeiro on September 27, 2020, 07:21:48 pm


"  TempodiBasic Thanks to read "


I read and executed all the codes

Title: Re: Line + Draw
Post by: bplus on September 27, 2020, 07:45:06 pm
Quote
I find very interesting your solutions, only Bplus have posted nothing!

@TempodiBasic  what?

What do you mean by this? I doubt it is how it looks. :)
Title: Re: Line + Draw
Post by: carloscordeiro on September 27, 2020, 08:30:37 pm
Bplus
Why the error in Felipe's box?
Title: Re: Line + Draw
Post by: bplus on September 27, 2020, 08:39:09 pm
@carloscordeiro

All SUBs and FUNCTIONs have to be listed after Main code, data statements and or GOSUBS from main code.

Should be OK to cut and paste the SUB lower or last in code.

Caution: Fellippe's box blacks out the interior space but if you use it first and then fill in the space with text you should be OK.

Old Moses has just what you would like I think, he did it without SUBs or FUNCTIONs which I don't think you are use to yet.
Title: Re: Line + Draw
Post by: TempodiBasic on September 28, 2020, 01:47:57 pm
@bplus
Quote
What do you mean by this?

Yes so we can say that this is a joke, can we?
Title: Re: Line + Draw
Post by: bplus on September 28, 2020, 01:51:08 pm
@bplus
Yes so we can say that this is a joke, can we?

LOL OK but you had me wondering :)