|
5 | 5 | import board
|
6 | 6 | import displayio
|
7 | 7 | import adafruit_display_text.label
|
8 |
| -from adafruit_display_shapes.line import Line |
9 | 8 | from adafruit_display_shapes.rect import Rect
|
| 9 | +from adafruit_display_shapes.polygon import Polygon |
10 | 10 | from adafruit_bitmap_font import bitmap_font
|
11 | 11 | from adafruit_matrixportal.network import Network
|
12 | 12 | from adafruit_matrixportal.matrix import Matrix
|
@@ -81,28 +81,22 @@ def redraw_frame(): # to adjust spacing at bottom later
|
81 | 81 | rect6.fill = color[2]
|
82 | 82 |
|
83 | 83 |
|
84 |
| -# draw the wings w line shapes |
85 |
| -wing_lines = [] |
| 84 | +# draw the wings w polygon shapes |
| 85 | +wing_polys = [] |
86 | 86 |
|
87 |
| -wing_lines.append(Line(3, 3, 10, 3, color[1])) # x-start, y-start, x-end, y-end, color |
88 |
| -wing_lines.append(Line(4, 4, 10, 4, color[1])) |
89 |
| -wing_lines.append(Line(5, 6, 10, 6, color[1])) |
90 |
| -wing_lines.append(Line(6, 7, 10, 7, color[1])) |
91 |
| -wing_lines.append(Line(7, 9, 10, 9, color[1])) |
92 |
| -wing_lines.append(Line(8, 10, 10, 10, color[1])) |
93 |
| -wing_lines.append(Line(54, 3, 61, 3, color[1])) |
94 |
| -wing_lines.append(Line(54, 4, 60, 4, color[1])) |
95 |
| -wing_lines.append(Line(54, 6, 59, 6, color[1])) |
96 |
| -wing_lines.append(Line(54, 7, 58, 7, color[1])) |
97 |
| -wing_lines.append(Line(54, 9, 57, 9, color[1])) |
98 |
| -wing_lines.append(Line(54, 10, 56, 10, color[1])) |
| 87 | +wing_polys.append(Polygon([(3, 3), (9, 3), (9, 4), (4, 4)], outline=color[1])) |
| 88 | +wing_polys.append(Polygon([(5, 6), (9, 6), (9, 7), (6, 7)], outline=color[1])) |
| 89 | +wing_polys.append(Polygon([(7, 9), (9, 9), (9, 10), (8, 10)], outline=color[1])) |
| 90 | +wing_polys.append(Polygon([(54, 3), (60, 3), (59, 4), (54, 4)], outline=color[1])) |
| 91 | +wing_polys.append(Polygon([(54, 6), (58, 6), (57, 7), (54, 7)], outline=color[1])) |
| 92 | +wing_polys.append(Polygon([(54, 9), (56, 9), (55, 10), (54, 10)], outline=color[1])) |
99 | 93 |
|
100 |
| -for wing_line in wing_lines: |
101 |
| - group.append(wing_line) |
| 94 | +for wing_poly in wing_polys: |
| 95 | + group.append(wing_poly) |
102 | 96 |
|
103 | 97 |
|
104 | 98 | def redraw_wings(index): # to change colors
|
105 |
| - for wing in wing_lines: |
| 99 | + for wing in wing_polys: |
106 | 100 | wing.outline = color[index]
|
107 | 101 |
|
108 | 102 |
|
|
0 commit comments