@@ -74,10 +74,10 @@ def set_backlight(val):
74
74
75
75
76
76
# ------------- Display Groups ------------- #
77
- splash = displayio .Group (max_size = 15 ) # The Main Display Group
78
- view1 = displayio .Group (max_size = 15 ) # Group for View 1 objects
79
- view2 = displayio .Group (max_size = 15 ) # Group for View 2 objects
80
- view3 = displayio .Group (max_size = 15 ) # Group for View 3 objects
77
+ splash = displayio .Group () # The Main Display Group
78
+ view1 = displayio .Group () # Group for View 1 objects
79
+ view2 = displayio .Group () # Group for View 2 objects
80
+ view3 = displayio .Group () # Group for View 3 objects
81
81
82
82
def hideLayer (hide_target ):
83
83
try :
@@ -98,11 +98,11 @@ def showLayer(show_target):
98
98
pyportal .set_background ('/images/loading.bmp' )
99
99
100
100
101
- bg_group = displayio .Group (max_size = 1 )
101
+ bg_group = displayio .Group ()
102
102
splash .append (bg_group )
103
103
104
104
105
- icon_group = displayio .Group (max_size = 1 )
105
+ icon_group = displayio .Group ()
106
106
icon_group .x = 180
107
107
icon_group .y = 120
108
108
icon_group .scale = 1
@@ -122,13 +122,15 @@ def set_image(group, filename):
122
122
if not filename :
123
123
return # we're done, no icon desired
124
124
125
+ # CircuitPython 6 & 7 compatible
125
126
image_file = open (filename , "rb" )
126
127
image = displayio .OnDiskBitmap (image_file )
127
- try :
128
- image_sprite = displayio .TileGrid (image , pixel_shader = getattr (image , 'pixel_shader' , displayio .ColorConverter ()))
129
- except TypeError :
130
- image_sprite = displayio .TileGrid (image , pixel_shader = getattr (image , 'pixel_shader' , displayio .ColorConverter ()),
131
- position = (0 , 0 ))
128
+ image_sprite = displayio .TileGrid (image , pixel_shader = getattr (image , 'pixel_shader' , displayio .ColorConverter ()))
129
+
130
+ # # CircuitPython 7+ compatible
131
+ # image = displayio.OnDiskBitmap(filename)
132
+ # image_sprite = displayio.TileGrid(image, pixel_shader=image.pixel_shader)
133
+
132
134
group .append (image_sprite )
133
135
134
136
set_image (bg_group , "/images/BGimage.bmp" )
@@ -143,28 +145,28 @@ def set_image(group, filename):
143
145
TABS_Y = 50
144
146
145
147
# Text Label Objects
146
- feed1_label = Label (font , text = "Text Wondow 1" , color = 0xE39300 , max_glyphs = 200 )
148
+ feed1_label = Label (font , text = "Text Wondow 1" , color = 0xE39300 )
147
149
feed1_label .x = TABS_X
148
150
feed1_label .y = TABS_Y
149
151
view1 .append (feed1_label )
150
152
151
- feed2_label = Label (font , text = "Text Wondow 2" , color = 0xFFFFFF , max_glyphs = 200 )
153
+ feed2_label = Label (font , text = "Text Wondow 2" , color = 0xFFFFFF )
152
154
feed2_label .x = TABS_X
153
155
feed2_label .y = TABS_Y
154
156
view2 .append (feed2_label )
155
157
156
- sensors_label = Label (font , text = "Data View" , color = 0x03AD31 , max_glyphs = 200 )
158
+ sensors_label = Label (font , text = "Data View" , color = 0x03AD31 )
157
159
sensors_label .x = TABS_X
158
160
sensors_label .y = TABS_Y
159
161
view3 .append (sensors_label )
160
162
161
- sensor_data = Label (font , text = "Data View" , color = 0x03AD31 , max_glyphs = 100 )
163
+ sensor_data = Label (font , text = "Data View" , color = 0x03AD31 )
162
164
sensor_data .x = TABS_X + 15
163
165
sensor_data .y = 170
164
166
view3 .append (sensor_data )
165
167
166
168
167
- text_hight = Label (font , text = "M" , color = 0x03AD31 , max_glyphs = 10 )
169
+ text_hight = Label (font , text = "M" , color = 0x03AD31 )
168
170
# return a reformatted string with word wrapping using PyPortal.wrap_nicely
169
171
def text_box (target , top , string , max_chars ):
170
172
text = pyportal .wrap_nicely (string , max_chars )
0 commit comments