06-28-2023, 05:36 AM
(This post was last modified: 06-28-2023, 09:08 AM by PhilOfPerth.)
(06-28-2023, 12:19 AM)TempodiBasic Wrote: HiThe S (scale) function looks interesting.
all different and working ways
but P of draw is not so bad
Draw wiki page
and taking the example 4
it is clear that all previous tips told in this thread have been used.Code: (Select All)SCREEN 12
DO
LOCATE 1, 1: INPUT "Enter a number 0 to 9: ", num
CLS
SELECT CASE num
CASE 0, 2, 3, 5 TO 9: PSET (20, 20), 12
DRAW "E2R30F2G2L30H2BR5P12,12" 'top horiz
END SELECT
SELECT CASE num
CASE 0, 4 TO 6, 8, 9: PSET (20, 20), 12
DRAW "F2D30G2H2U30E2BD5P12,12" 'left top vert
END SELECT
SELECT CASE num
CASE 0, 2, 6, 8: PSET (20, 54), 12
DRAW "F2D30G2H2U30E2BD5P12, 12" 'left bot vert
END SELECT
SELECT CASE num
CASE 2 TO 6, 8, 9: PSET (20, 54), 12
DRAW "E2R30F2G2L30H2BR5P12, 12" 'middle horiz
END SELECT
SELECT CASE num
CASE 0 TO 4, 7 TO 9: PSET (54, 20), 12
DRAW "F2D30G2H2U30E2BD5P12,12" 'top right vert
END SELECT
SELECT CASE num
CASE 0, 1, 3 TO 9: PSET (54, 54), 12
DRAW "F2D30G2H2U30E2BD5P12,12" 'bottom right vert
END SELECT
SELECT CASE num
CASE 0, 2, 3, 5, 6, 8: PSET (20, 88), 12
DRAW "E2R30F2G2L30H2BR5P12,12" 'bottom horiz
END SELECT
LOOP UNTIL num > 9
P of DRAW works fine also in 32 bit color
here the same example using a screen 32 and a col$ _RGBA32
I remember an exercise of the Terry's tutorial to build a landscape with DRAW, another to create Basic shapes to use for landscape.Code: (Select All)Screen _NewImage(1000, 800, 32)
Col$ = Str$(_RGBA32(222, 116, 44, 255))
paint$ = "P" + Col$ + "," + Col$
Do
Locate 1, 1: Input "Enter a number 0 to 9: ", num
Cls
Select Case num
Case 0, 2, 3, 5 To 9: PSet (20, 20), Val(Col$)
Draw "E2R30F2G2L30H2BR5" + paint$ 'top horiz
End Select
Select Case num
Case 0, 4 To 6, 8, 9: PSet (20, 20), Val(Col$)
Draw "F2D30G2H2U30E2BD5" + paint$ 'left top vert
End Select
Select Case num
Case 0, 2, 6, 8: PSet (20, 54), Val(Col$)
Draw "F2D30G2H2U30E2BD5" + paint$ 'left bot vert
End Select
Select Case num
Case 2 To 6, 8, 9: PSet (20, 54), Val(Col$)
Draw "E2R30F2G2L30H2BR5" + paint$ 'middle horiz
End Select
Select Case num
Case 0 To 4, 7 To 9: PSet (54, 20), Val(Col$)
Draw "F2D30G2H2U30E2BD5" + paint$ 'top right vert
End Select
Select Case num
Case 0, 1, 3 To 9: PSet (54, 54), Val(Col$)
Draw "F2D30G2H2U30E2BD5" + paint$ 'bottom right vert
End Select
Select Case num
Case 0, 2, 3, 5, 6, 8: PSet (20, 88), Val(Col$)
Draw "E2R30F2G2L30H2BR5" + paint$ 'bottom horiz
End Select
Loop Until num > 9
In this last case you will find very useful the function S (scale) of DRAW to get different size of the same shape.
I've experimented with it briefly, and with s2 at the front, the border and fill colors were transposed.
More experimenting needed.
Edit: No, they are not transposed, it seems the shape "leaks"... trying some more...
Edit 2:
The reason for the "leak" was that the point for painting was outside the shape when re-sized.
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, W.A.)