diff --git a/examples/progressbar_simpletest.py b/examples/progressbar_simpletest.py index 70952d3..ecf7332 100644 --- a/examples/progressbar_simpletest.py +++ b/examples/progressbar_simpletest.py @@ -7,20 +7,15 @@ splash = displayio.Group(max_size=10) board.DISPLAY.show(splash) -# Make a background color fill -color_bitmap = displayio.Bitmap(320, 240, 1) -color_palette = displayio.Palette(1) -color_palette[0] = 0x0 -bg_sprite = displayio.TileGrid(color_bitmap, x=0, y=0, pixel_shader=color_palette) -splash.append(bg_sprite) -########################################################################## - # set progress bar width and height relative to board's display -x = board.DISPLAY.width // 5 +width = board.DISPLAY.width - 40 +height = 30 + +x = board.DISPLAY.width // 2 - width // 2 y = board.DISPLAY.height // 3 # Create a new progress_bar object at (x, y) -progress_bar = ProgressBar(x, y, 200, 30, 1.0) +progress_bar = ProgressBar(x, y, width, height, 1.0) # Append progress_bar to the splash group splash.append(progress_bar)