|
22 | 22 | spi, command=tft_dc, chip_select=tft_cs, reset=board.D9
|
23 | 23 | )
|
24 | 24 |
|
25 |
| -display = ST7789(display_bus, width=320, height=240, rotation=90) |
| 25 | +display = ST7789(display_bus, width=280, height=240, rowstart=20, rotation=90) |
26 | 26 |
|
27 | 27 | # Make the display context
|
28 | 28 | splash = displayio.Group()
|
29 | 29 | display.show(splash)
|
30 | 30 |
|
31 |
| -color_bitmap = displayio.Bitmap(320, 240, 1) |
| 31 | +color_bitmap = displayio.Bitmap(280, 240, 1) |
32 | 32 | color_palette = displayio.Palette(1)
|
33 | 33 | color_palette[0] = 0x00FF00 # Bright Green
|
34 | 34 |
|
35 | 35 | bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0)
|
36 | 36 | splash.append(bg_sprite)
|
37 | 37 |
|
38 | 38 | # Draw a smaller inner rectangle
|
39 |
| -inner_bitmap = displayio.Bitmap(280, 200, 1) |
| 39 | +inner_bitmap = displayio.Bitmap(240, 200, 1) |
40 | 40 | inner_palette = displayio.Palette(1)
|
41 | 41 | inner_palette[0] = 0xAA0088 # Purple
|
42 | 42 | inner_sprite = displayio.TileGrid(inner_bitmap, pixel_shader=inner_palette, x=20, y=20)
|
43 | 43 | splash.append(inner_sprite)
|
44 | 44 |
|
45 | 45 | # Draw a label
|
46 |
| -text_group = displayio.Group(scale=3, x=57, y=120) |
| 46 | +text_group = displayio.Group(scale=3, x=37, y=120) |
47 | 47 | text = "Hello World!"
|
48 | 48 | text_area = label.Label(terminalio.FONT, text=text, color=0xFFFF00)
|
49 | 49 | text_group.append(text_area) # Subgroup for text scaling
|
|
0 commit comments