Skip to content

Commit 2fb1bd1

Browse files
authored
Merge pull request #14 from FoamyGuy/simpletest_improvement
Simpletest improvements
2 parents 247b51d + 9025506 commit 2fb1bd1

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

examples/progressbar_simpletest.py

+5-10
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,15 @@
77
splash = displayio.Group(max_size=10)
88
board.DISPLAY.show(splash)
99

10-
# Make a background color fill
11-
color_bitmap = displayio.Bitmap(320, 240, 1)
12-
color_palette = displayio.Palette(1)
13-
color_palette[0] = 0x0
14-
bg_sprite = displayio.TileGrid(color_bitmap, x=0, y=0, pixel_shader=color_palette)
15-
splash.append(bg_sprite)
16-
##########################################################################
17-
1810
# set progress bar width and height relative to board's display
19-
x = board.DISPLAY.width // 5
11+
width = board.DISPLAY.width - 40
12+
height = 30
13+
14+
x = board.DISPLAY.width // 2 - width // 2
2015
y = board.DISPLAY.height // 3
2116

2217
# Create a new progress_bar object at (x, y)
23-
progress_bar = ProgressBar(x, y, 200, 30, 1.0)
18+
progress_bar = ProgressBar(x, y, width, height, 1.0)
2419

2520
# Append progress_bar to the splash group
2621
splash.append(progress_bar)

0 commit comments

Comments
 (0)