peng3d.gui.text - Textual Widgets

class peng3d.gui.text.Label(name, submenu, window, peng, pos=None, size=None, bg=None, label='Label', font_size=16, font='Arial', font_color=[62, 67, 73, 255])[source]

Simple widget that can display any single-line non-formatted string.

This widget does not use any background by default.

The default font color is chosen to work on the default background color and may need to be changed if the background color is changed.

label

Property for accessing the text of the label.

redraw_label()[source]

Re-draws the text by calculating its position.

Currently, the text will always be centered on the position of the label.

class peng3d.gui.text.TextInput(name, submenu, window, peng, pos=None, size=None, bg=None, text='', default='', border=[4, 4], borderstyle='flat', font_size=16, font='Arial', font_color=[62, 67, 73, 255], font_color_default=[62, 67, 73, 200], allow_overflow=False)[source]

Basic Textual Input widget.

By default, this widget uses TextInputBackground as its Background class.

The optional default text will only be displayed if the text is empty.

The allow_overflow flag determines if the text entered can be longer than the size of the TextInput.

default

Property for accessing the default text.

redraw_label()[source]

Re-draws the label by calculating its position.

Currently, the label will always be centered on the position of the label.

text

Property for accessing the text.

class peng3d.gui.text.TextInputBackground(widget, border, borderstyle='flat')[source]

Background for the TextInput Widget.

This background uses the button drawing routines and adds a cursor.