Skip to content

Commit ee455d2

Browse files
committed
draw some shapes why doncha
1 parent a38d7d5 commit ee455d2

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

examples/shapes_simpletest.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import displayio
2+
import board
3+
from adafruit_display_shapes.rect import Rect
4+
from adafruit_display_shapes.circle import Circle
5+
from adafruit_display_shapes.roundrect import RoundRect
6+
7+
# Make the display context
8+
splash = displayio.Group(max_size=10)
9+
board.DISPLAY.show(splash)
10+
11+
# Make a background color fill
12+
color_bitmap = displayio.Bitmap(320, 240, 1)
13+
color_palette = displayio.Palette(1)
14+
color_palette[0] = 0xFFFFFF
15+
bg_sprite = displayio.TileGrid(color_bitmap,
16+
pixel_shader=color_palette,
17+
position=(0, 0))
18+
print(bg_sprite.position)
19+
splash.append(bg_sprite)
20+
##########################################################################
21+
22+
rect = Rect(80, 20, 41, 41, fill=0x0)
23+
splash.append(rect)
24+
25+
circle = Circle(100, 100, 20, fill=0x00FF00, outline=0xFF00FF)
26+
splash.append(circle)
27+
28+
rect2 = Rect(50, 100, 61, 81, outline=0x0, stroke=3)
29+
splash.append(rect2)
30+
31+
roundrect = RoundRect(10, 10, 61, 81, 10, fill=0x0, outline=0xFF00FF, stroke=6)
32+
splash.append(roundrect)
33+
34+
35+
while True:
36+
pass

0 commit comments

Comments
 (0)