35
35
IMAGE_SPRITE_X = (display .width // 3 ) - 10
36
36
IMAGE_SPRITE_Y = display .height // 5
37
37
38
- # Create a displayIO Group
38
+ # Create a displayIO Group
39
39
group = displayio .Group ()
40
40
41
41
# Draw the background
66
66
# Show the group
67
67
display .root_group = group
68
68
69
- def set_image (group , filename ):
69
+ def set_image (image_group , filename ):
70
70
"""Sets the image file for a given group for display."""
71
71
print (f"Set image to { filename } " )
72
- if group :
73
- group .pop ()
72
+ if image_group :
73
+ image_group .pop ()
74
74
75
75
image_file = open (filename , "rb" )
76
76
image = displayio .OnDiskBitmap (image_file )
77
77
image_sprite = displayio .TileGrid (image ,
78
78
pixel_shader = getattr (image , 'pixel_shader' , displayio .ColorConverter ()))
79
79
image_sprite .x = IMAGE_SPRITE_X
80
80
image_sprite .y = IMAGE_SPRITE_Y
81
- group .append (image_sprite )
81
+ image_group .append (image_sprite )
82
82
83
83
prv_location = None
84
84
while True :
@@ -105,7 +105,7 @@ def set_image(group, filename):
105
105
else :
106
106
print ("Location not found in images!" )
107
107
# Update the location text
108
- text_area_location .text = f "Error: Unknown Value!"
108
+ text_area_location .text = "Error: Unknown Value!"
109
109
# Show the refreshed group
110
110
display .root_group = group
111
111
except RuntimeError as e :
0 commit comments