feat(text_input): add text input class with initialization
This commit is contained in:
@@ -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)
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user