code.py
1 # SPDX-FileCopyrightText: 2020 Tim C, written for Adafruit Industries 2 # 3 # SPDX-License-Identifier: MIT 4 """ 5 Illustrate how the scale parameter of displayio.Group can be used to 6 change the size of label and bitmap_label 7 """ 8 import board 9 import displayio 10 import terminalio 11 from adafruit_display_text import label 12 13 # Built-in display 14 display = board.DISPLAY 15 16 # Make the display context 17 main_group = displayio.Group() 18 display.show(main_group) 19 20 font = terminalio.FONT 21 22 reg_label = label.Label(font=font, text="scale=1", scale=1) 23 reg_label.anchor_point = (0, 0) 24 reg_label.anchored_position = (20, 20) 25 26 scale2_lbl = label.Label(font=font, text="scale=2", scale=2) 27 28 scale2_lbl.anchor_point = (0, 0) 29 scale2_lbl.anchored_position = (20, 40) 30 31 scale3_lbl = label.Label(font=font, text="scale=3", scale=3) 32 33 scale3_lbl.anchor_point = (0, 0) 34 scale3_lbl.anchored_position = (20, 70) 35 36 main_group.append(reg_label) 37 main_group.append(scale3_lbl) 38 main_group.append(scale2_lbl) 39 while True: 40 pass