Skip to content

Commit c78251c

Browse files
committed
switched Line to Polygon for wing drawing
1 parent 47f5029 commit c78251c

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

Matrix_On_Air/matrix_on_air.py

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import board
66
import displayio
77
import adafruit_display_text.label
8-
from adafruit_display_shapes.line import Line
98
from adafruit_display_shapes.rect import Rect
9+
from adafruit_display_shapes.polygon import Polygon
1010
from adafruit_bitmap_font import bitmap_font
1111
from adafruit_matrixportal.network import Network
1212
from adafruit_matrixportal.matrix import Matrix
@@ -81,28 +81,22 @@ def redraw_frame(): # to adjust spacing at bottom later
8181
rect6.fill = color[2]
8282

8383

84-
# draw the wings w line shapes
85-
wing_lines = []
84+
# draw the wings w polygon shapes
85+
wing_polys = []
8686

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]))
9993

100-
for wing_line in wing_lines:
101-
group.append(wing_line)
94+
for wing_poly in wing_polys:
95+
group.append(wing_poly)
10296

10397

10498
def redraw_wings(index): # to change colors
105-
for wing in wing_lines:
99+
for wing in wing_polys:
106100
wing.outline = color[index]
107101

108102

0 commit comments

Comments
 (0)