Skip to content

YashJogani/pygame-textinput

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 

Repository files navigation

Pygame TextBox Input Module

Features

  • This Class lets you write text at the blinking cursor.
  • Wraps text to the next line if it exceeds the max_width.
  • Enter, Delete, Home, End, Page Up and Page Down key works.
  • Cursor can be moved using arrow keys or click on character to jump directly.
  • Scrolling using mouse or scroll bar.
  • Text Selection using mouse.
  • Cut, Copy, Paste and Select all using shortcut.
  • Ctrl and Shift shortcut works.
  • It works just like you expect.

Using the Module

Its very simple to use this module. Create an object of the Class and then feed the update() with pygame-events.

  • It will create surfaces of each line and store it in list only when any changes are made in the input_string for efficient rendering. List can be get using get_surface().
  • Then call the render().
  • If you don't want the text object to be updated with events.
    • Pass False to update().
    • It will not take any input and it will not render cursor too indicating its inactive.

Some part of code is borrowed from Pygame Text Input under the MIT license.

About

A module for text input in pygame. It supports wrapping, key shortcuts and selection of text.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy