Skip to content

Commit ca59f04

Browse files
committed
Adding border around messages
1 parent 6eb5897 commit ca59f04

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

beetle.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ def calibrate():
109109
message = f"Sit still and relax for {remaining_time} seconds" # Update the message dynamically
110110
text = font.render(message, True, (0, 0, 0))
111111
text_rect = text.get_rect(center=(400, 300))
112+
border_padding = 20 # Space around text
113+
border_rect = pygame.Rect(text_rect.left - border_padding, text_rect.top - border_padding, text_rect.width + 2 * border_padding, text_rect.height + 2 * border_padding)
114+
pygame.draw.rect(screen, (0, 0, 0), border_rect, border_radius=20, width=3)
115+
116+
# Render text on screen
112117
screen.blit(text, text_rect)
113118
pygame.display.update()
114119

0 commit comments

Comments
 (0)