How do I paint a shape?
#9
Hi
all different and working ways
but P of draw is not so bad
Draw wiki page

and taking the example 4
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
it is  clear that all previous tips told in this thread have been used.

P of DRAW works fine also in 32 bit color

here the same example using a screen 32 and a col$ _RGBA32
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
I remember an exercise of the Terry's tutorial to build a landscape with DRAW, another to create Basic shapes to use for landscape.
In this last case you will find very useful the function S (scale) of DRAW to get different size of the same shape.
Reply


Messages In This Thread
How do I paint a shape? - by PhilOfPerth - 06-27-2023, 08:00 AM
RE: How do I paint a shape? - by mnrvovrfc - 06-27-2023, 10:54 AM
RE: How do I paint a shape? - by OldMoses - 06-27-2023, 11:22 AM
RE: How do I paint a shape? - by TerryRitchie - 06-27-2023, 11:56 AM
RE: How do I paint a shape? - by bplus - 06-27-2023, 12:26 PM
RE: How do I paint a shape? - by Petr - 06-27-2023, 02:05 PM
RE: How do I paint a shape? - by Petr - 06-27-2023, 02:19 PM
RE: How do I paint a shape? - by PhilOfPerth - 06-28-2023, 05:20 AM
RE: How do I paint a shape? - by mnrvovrfc - 06-28-2023, 07:13 PM
RE: How do I paint a shape? - by Petr - 06-27-2023, 02:39 PM
RE: How do I paint a shape? - by TempodiBasic - 06-28-2023, 12:19 AM
RE: How do I paint a shape? - by PhilOfPerth - 06-28-2023, 05:36 AM
RE: How do I paint a shape? - by bplus - 06-28-2023, 01:29 AM
RE: How do I paint a shape? - by mnrvovrfc - 06-28-2023, 02:08 AM
RE: How do I paint a shape? - by PhilOfPerth - 06-28-2023, 05:04 AM
RE: How do I paint a shape? - by bplus - 06-28-2023, 02:16 AM
RE: How do I paint a shape? - by mnrvovrfc - 06-28-2023, 02:50 AM
RE: How do I paint a shape? - by bplus - 06-28-2023, 03:03 AM
RE: How do I paint a shape? - by bplus - 06-28-2023, 02:30 AM
RE: How do I paint a shape? - by PhilOfPerth - 06-28-2023, 05:03 AM
RE: How do I paint a shape? - by TempodiBasic - 06-28-2023, 09:24 PM
RE: How do I paint a shape? - by TempodiBasic - 06-28-2023, 10:09 PM



Users browsing this thread: 10 Guest(s)