From 3f2c419007e29308b9fbe5aabef7bd1a54ea829c Mon Sep 17 00:00:00 2001 From: FoamyGuy Date: Sun, 2 Aug 2020 19:12:37 -0500 Subject: [PATCH 1/2] remove unneeded background bitmap from simpletest. Make width based on screen size in simpletest --- examples/progressbar_simpletest.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/examples/progressbar_simpletest.py b/examples/progressbar_simpletest.py index 70952d3..095d11f 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) From 9025506cb70924947901bb8fd96e4188c5f05d15 Mon Sep 17 00:00:00 2001 From: FoamyGuy Date: Sun, 2 Aug 2020 19:18:22 -0500 Subject: [PATCH 2/2] black format --- examples/progressbar_simpletest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/progressbar_simpletest.py b/examples/progressbar_simpletest.py index 095d11f..ecf7332 100644 --- a/examples/progressbar_simpletest.py +++ b/examples/progressbar_simpletest.py @@ -8,7 +8,7 @@ board.DISPLAY.show(splash) # set progress bar width and height relative to board's display -width = board.DISPLAY.width-40 +width = board.DISPLAY.width - 40 height = 30 x = board.DISPLAY.width // 2 - width // 2