|
| 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