Skip to content

Commit 8c98dac

Browse files
committed
working on comparison example
1 parent b6662ef commit 8c98dac

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/display_text_label_vs_bitmap_label_alternating.py renamed to examples/display_text_label_vs_bitmap_label_comparison.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@
110110
# create group
111111

112112
long_string = "The purple snake\nbrings python fun\nto everyone."
113-
short_string = "Hello World"
114113

115114
#####
116115
# Create the "bitmap_label.py" versions of the text labels.
@@ -120,9 +119,8 @@
120119

121120
bmap_label1 = bitmap_label.Label(
122121
font=fontToUse,
123-
text=short_string,
122+
text="bitmap_label",
124123
color=0xFFFFFF,
125-
max_glyphs=len(short_string),
126124
background_color=0xFF0000,
127125
padding_bottom=0,
128126
padding_left=0,
@@ -155,6 +153,8 @@
155153
gc.collect()
156154
bitmap_label_end = gc.mem_free()
157155

156+
print("bitmap_label used: {} memory".format(bitmap_label_start - bitmap_label_end))
157+
158158
bmap_group = displayio.Group(max_size=4) # Create a group for displaying
159159
bmap_group.append(bmap_label1)
160160
bmap_group.append(bmap_label2)
@@ -168,9 +168,8 @@
168168

169169
label1 = label.Label(
170170
font=fontToUse,
171-
text=short_string,
171+
text="label",
172172
color=0xFFFFFF,
173-
max_glyphs=len(short_string),
174173
background_color=0xFF0000,
175174
padding_bottom=0,
176175
padding_left=0,
@@ -203,6 +202,7 @@
203202
gc.collect()
204203
label_end = gc.mem_free()
205204

205+
print("label used: {} memory".format(label_start - label_end))
206206
label_group = displayio.Group(max_size=4) # Create a group for displaying
207207
label_group.append(label1)
208208
label_group.append(label2)

0 commit comments

Comments
 (0)