A little module for creating text boxes in Pygame and Python 2.7
Requires pygame (obviously)
https://benedsmith.wordpress.com/
Import TextBox
textbox1 = TextBox.TextBox(rect, text, background_colour, text_colour, font, font_size)
The rect - (x, y, width, height) Note: x and y are the top left corner of the textbox. Set to (0, 0, 400, 25) as default.
if event.type == pygame.KEYDOWN:
if textbox1.active == True:
textbox1.text_input(event)
textbox1.test_collide(event)
textbox1.draw(textbox1.text, screen)