adafruit / Adafruit_CircuitPython_Display_Text

Library to display text using displayio
MIT License
57 stars 38 forks source link

adding_verbose_option #181

Closed jposada202020 closed 1 year ago

jposada202020 commented 1 year ago

Related to #171

tested with:

import time
import board
import terminalio
import displayio
from adafruit_display_text import bitmap_label

display = board.DISPLAY

main_group = displayio.Group()
MEDIUM_FONT = bitmap_font.load_font("LeagueSpartan-Bold-16.bdf")

TIME_PAUSE = 1

# Testing creating label with initial position
text_area = bitmap_label.Label(terminalio.FONT, x=20, y=20, text="Verbose Option Testing", verbose=True)
main_group.append(text_area)
display.show(main_group)
time.sleep(TIME_PAUSE)

# Testing Verbose
text_area.text = "Testing Verbose=True"
text_initial_specs = bitmap_label.Label(
    MEDIUM_FONT,
    text="Verbose",
    x=display.width // 2,
    y=display.height // 2,
    verbose=True,
)
main_group.append(text_initial_specs)
display.show(main_group)
time.sleep(TIME_PAUSE)
main_group.pop()

text_area.text = "Testing Verbose=False"
print("putting the Verbose=False will no show the warning")
time.sleep(TIME_PAUSE)
text_initial_specs = bitmap_label.Label(
    MEDIUM_FONT,
    text=" Not Verbose",
    x=display.width // 2,
    y=display.height // 2,
    verbose=False,
)
main_group.append(text_initial_specs)
display.show(main_group)
time.sleep(TIME_PAUSE)
main_group.pop()

text_area.text = "Finished"
print("Tests finished")