diff --git a/resources/background.png b/resources/background.png index 22de263..2f5c6c9 100644 Binary files a/resources/background.png and b/resources/background.png differ diff --git a/src/forge_invar/display.py b/src/forge_invar/display.py index 96a74aa..f60618c 100644 --- a/src/forge_invar/display.py +++ b/src/forge_invar/display.py @@ -21,6 +21,7 @@ from .constants import ( ) from .enums import ForgeState from .forge_data import ForgeData +from .glsl_funcs import mod FONT_1 = ImageFont.truetype(FONT_1_PATH, 5) FONT_2 = ImageFont.truetype(FONT_2_PATH, 8) @@ -63,10 +64,30 @@ def __get_running_display(data: ForgeData) -> Image.Image: draw.rectangle((6, 7, 6 + int(53 * data.beat_progress), 10), fill="white", width=0) # time - draw.text((94, -2), f"{int(data.time)}", fill="white", font=FONT_1) - draw.rectangle( - (67, 7, 67 + int(53 * data.time_progress), 10), fill="white", width=0 - ) + if data.demo: + draw.text((68, -2), "DEMO", fill="white", font=FONT_1) + else: + draw.text((68, -2), f"TIME: {int(data.time)}", fill="white", font=FONT_1) + + if data.auto_random: + draw.rectangle( + ( + 67, 7, + 67 + + int( + 53 + * mod(data.beats, data.auto_random_cycle) + / data.auto_random_cycle + ), + 10, + ), + fill="white", + width=0, + ) + else: + draw.rectangle( + (67, 7, 67 + int(53 * data.time_progress), 10), fill="white", width=0 + ) # page draw.circle((55 + 8 * data.page, 61), 2, fill="white") diff --git a/src/forge_invar/tools/gen_img.py b/src/forge_invar/tools/gen_img.py index e27487f..6348525 100644 --- a/src/forge_invar/tools/gen_img.py +++ b/src/forge_invar/tools/gen_img.py @@ -33,7 +33,6 @@ def generate_background_image() -> None: draw.rectangle((6, 6, 60, 11), outline="white", fill="black") # time - draw.text((68, -2), "TIME:", fill="white", font=FONT_1) draw.rectangle((67, 6, 121, 11), outline="white", fill="black") # pipes