Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 44 additions & 44 deletions examples/display_text_advance_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
# Tests
text_area = label.Label(terminalio.FONT, text="Circuit Python")
main_group.append(text_area)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)

# Testing position setter
text_area.x = 10
text_area.y = 10
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)

# Testing creating label with initial position
Expand All @@ -57,35 +57,35 @@
background_color=0x004499,
)
main_group.append(warning_text)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)

text_area.text = "Testing Position"
text_middle = label.Label(
terminalio.FONT, text="Circuit", x=display.width // 2, y=display.height // 2
)
main_group.append(text_middle)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)

# Testing Text Setter
text_area.text = "Testing Changing Text"
text_middle.text = "Python"
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)

# Testing a and y getter and setter
text_area.text = "Testing Changing Position"
text_middle.x = text_middle.x - 50
text_middle.y = text_middle.y - 50
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)

# Testing font Getter and setter
text_area.text = "Testing Changing FONT"
if isinstance(text_middle.font, fontio.BuiltinFont):
text_middle.font = MEDIUM_FONT
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)

# Once this working we create another label with all the initial specs
Expand All @@ -100,11 +100,11 @@
y=display.height // 2,
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)

text_initial_specs.color = 0x004400
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
main_group.pop()

Expand All @@ -118,11 +118,11 @@
color=0xFFFFFF,
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)

text_initial_specs.background_color = 0x990099
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
main_group.pop()

Expand All @@ -148,7 +148,7 @@
background_tight=False,
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
main_group.pop()
main_group.pop()
Expand All @@ -168,7 +168,7 @@
padding_left=10,
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
main_group.pop()

Expand All @@ -187,7 +187,7 @@
padding_left=10,
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)

try:
Expand All @@ -206,7 +206,7 @@
)
main_group.append(warning_text)
time.sleep(TIME_PAUSE)
display.show(main_group)
display.root_group = main_group

main_group.pop()

Expand All @@ -227,11 +227,11 @@
anchor_point=(0.5, 0.5),
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)

text_initial_specs.scale = 2
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
main_group.pop()

Expand All @@ -257,7 +257,7 @@
base_alignment=True,
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
main_group.pop()
main_group.pop()
Expand All @@ -280,7 +280,7 @@
label_direction="UPR",
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
main_group.pop()

Expand All @@ -301,7 +301,7 @@
label_direction="DWR",
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
main_group.pop()

Expand All @@ -322,7 +322,7 @@
label_direction="TTB",
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
main_group.pop()

Expand All @@ -343,23 +343,23 @@
label_direction="RTL",
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
main_group.pop()

main_group.pop()

# Testing creating label with initial position
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
text_area = bitmap_label.Label(terminalio.FONT, text="Circuit Python")
main_group.append(text_area)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
# Testing position setter
text_area.x = 10
text_area.y = 10
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
text_area.text = "Testing initiating without text"
try:
Expand All @@ -381,28 +381,28 @@
terminalio.FONT, text="Circuit", x=display.width // 2, y=display.height // 2
)
main_group.append(text_middle)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)

# Testing Text Setter
text_area.text = "Testing Changing Text"
text_middle.text = "Python"
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)

# Testing a and y getter and setter
text_area.text = "Testing Changing Position"
text_middle.x = text_middle.x - 50
text_middle.y = text_middle.y - 50
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)

# Testing font Getter and setter
text_area.text = "Testing Changing FONT"
if isinstance(text_middle.font, fontio.BuiltinFont):
print("Font was BuiltinFont")
text_middle.font = MEDIUM_FONT
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)

# Once this working we create another label with all the initial specs
Expand All @@ -417,11 +417,11 @@
y=display.height // 2,
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)

text_initial_specs.color = 0x004400
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
main_group.pop()

Expand All @@ -435,11 +435,11 @@
color=0xFFFFFF,
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)

text_initial_specs.background_color = 0x990099
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
main_group.pop()

Expand All @@ -465,7 +465,7 @@
background_tight=False,
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
main_group.pop()
main_group.pop()
Expand All @@ -485,7 +485,7 @@
padding_left=10,
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
main_group.pop()

Expand All @@ -504,7 +504,7 @@
padding_left=10,
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)

try:
Expand All @@ -523,7 +523,7 @@
)
main_group.append(warning_text)
time.sleep(TIME_PAUSE)
display.show(main_group)
display.root_group = main_group

main_group.pop()

Expand All @@ -544,11 +544,11 @@
anchor_point=(0.5, 0.5),
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)

text_initial_specs.scale = 2
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
main_group.pop()

Expand All @@ -574,7 +574,7 @@
base_alignment=True,
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
main_group.pop()
main_group.pop()
Expand All @@ -597,7 +597,7 @@
label_direction="UPR",
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
main_group.pop()

Expand All @@ -618,7 +618,7 @@
label_direction="DWR",
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
main_group.pop()

Expand All @@ -639,7 +639,7 @@
label_direction="UPD",
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
main_group.pop()

Expand All @@ -660,7 +660,7 @@
label_direction="RTL",
)
main_group.append(text_initial_specs)
display.show(main_group)
display.root_group = main_group
time.sleep(TIME_PAUSE)
main_group.pop()

Expand Down
2 changes: 1 addition & 1 deletion examples/display_text_anchored_position.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
text_group.append(text_area_bottom_left)
text_group.append(text_area_bottom_right)

board.DISPLAY.show(text_group)
board.DISPLAY.root_group = text_group

while True:
pass
2 changes: 1 addition & 1 deletion examples/display_text_background_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

print("background color is {:06x}".format(text_area.background_color))

board.DISPLAY.show(text_area)
board.DISPLAY.root_group = text_area

time.sleep(2)
text_area.background_color = 0xFF0000
Expand Down
4 changes: 2 additions & 2 deletions examples/display_text_background_color_padding.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
native_frames_per_second=90,
)

display.show(None)
display.root_group = None

# font=terminalio.FONT # this is the Builtin fixed dimension font

Expand All @@ -82,7 +82,7 @@

display.auto_refresh = True
myGroup = displayio.Group()
display.show(myGroup)
display.root_group = myGroup

text_area = []
myPadding = 4
Expand Down
2 changes: 1 addition & 1 deletion examples/display_text_bitmap_label_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
text_area = bitmap_label.Label(terminalio.FONT, text=text)
text_area.x = 10
text_area.y = 10
board.DISPLAY.show(text_area)
board.DISPLAY.root_group = text_area
while True:
pass
Loading