Skip to content

Commit 02f26d9

Browse files
author
Margaret Matocha
committed
updated anchor_positions example so that anchor positions correspond to the edges and corners of the display
1 parent 12d8b25 commit 02f26d9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

examples/display_text_anchored_position.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,39 @@
1212

1313
text_area_top_left = label.Label(terminalio.FONT, text=TEXT)
1414
text_area_top_left.anchor_point = (0.0, 0.0)
15-
text_area_top_left.anchored_position = (10, 10)
15+
text_area_top_left.anchored_position = (0, 0)
1616

1717
text_area_top_middle = label.Label(terminalio.FONT, text=TEXT)
1818
text_area_top_middle.anchor_point = (0.5, 0.0)
19-
text_area_top_middle.anchored_position = (DISPLAY_WIDTH / 2, 10)
19+
text_area_top_middle.anchored_position = (DISPLAY_WIDTH / 2, 0)
2020

2121
text_area_top_right = label.Label(terminalio.FONT, text=TEXT)
2222
text_area_top_right.anchor_point = (1.0, 0.0)
23-
text_area_top_right.anchored_position = (DISPLAY_WIDTH - 10, 10)
23+
text_area_top_right.anchored_position = (DISPLAY_WIDTH, 0)
2424

2525
text_area_middle_left = label.Label(terminalio.FONT, text=TEXT)
2626
text_area_middle_left.anchor_point = (0.0, 0.5)
27-
text_area_middle_left.anchored_position = (10, DISPLAY_HEIGHT / 2)
27+
text_area_middle_left.anchored_position = (0, DISPLAY_HEIGHT / 2)
2828

2929
text_area_middle_middle = label.Label(terminalio.FONT, text=TEXT)
3030
text_area_middle_middle.anchor_point = (0.5, 0.5)
3131
text_area_middle_middle.anchored_position = (DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2)
3232

3333
text_area_middle_right = label.Label(terminalio.FONT, text=TEXT)
3434
text_area_middle_right.anchor_point = (1.0, 0.5)
35-
text_area_middle_right.anchored_position = (DISPLAY_WIDTH - 10, DISPLAY_HEIGHT / 2)
35+
text_area_middle_right.anchored_position = (DISPLAY_WIDTH, DISPLAY_HEIGHT / 2)
3636

3737
text_area_bottom_left = label.Label(terminalio.FONT, text=TEXT)
3838
text_area_bottom_left.anchor_point = (0.0, 1.0)
39-
text_area_bottom_left.anchored_position = (10, DISPLAY_HEIGHT)
39+
text_area_bottom_left.anchored_position = (0, DISPLAY_HEIGHT)
4040

4141
text_area_bottom_middle = label.Label(terminalio.FONT, text=TEXT)
4242
text_area_bottom_middle.anchor_point = (0.5, 1.0)
4343
text_area_bottom_middle.anchored_position = (DISPLAY_WIDTH / 2, DISPLAY_HEIGHT)
4444

4545
text_area_bottom_right = label.Label(terminalio.FONT, text=TEXT)
4646
text_area_bottom_right.anchor_point = (1.0, 1.0)
47-
text_area_bottom_right.anchored_position = (DISPLAY_WIDTH - 10, DISPLAY_HEIGHT)
47+
text_area_bottom_right.anchored_position = (DISPLAY_WIDTH, DISPLAY_HEIGHT)
4848

4949
text_group = displayio.Group(max_size=9)
5050
text_group.append(text_area_top_middle)

0 commit comments

Comments
 (0)