From dbbd40b58aac67195478ae0dc2a039968d05c65a Mon Sep 17 00:00:00 2001 From: Kevin Baumgartner Date: Thu, 7 May 2026 20:55:22 +0200 Subject: [PATCH] feat(text_input): add text input class with initialization --- src/text_input.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/text_input.py diff --git a/src/text_input.py b/src/text_input.py new file mode 100644 index 0000000..e215b96 --- /dev/null +++ b/src/text_input.py @@ -0,0 +1,20 @@ +import pygame + +class TextInput: + def __init__(self, width, height, pos_x, pos_y): + self.rect = pygame.Rect(pos_x, pos_y, width, height) + + self.font = pygame.font.SysFont("Arial", 22) + + # input text + self.text = "" + + self.active = True + + # colors + self.text_color = (255, 255, 255) + self.border_color = (255, 255, 255) + self.active_border_color = (0, 255, 0) + self.background_color = (30, 30, 30) + +