pymasep.interface.ui_input

Classes

UIInput

General and abstract input with label and a value to write or select

Module Contents

class pymasep.interface.ui_input.UIInput(relative_rect, manager, container, label_text, waited_type, error_resource)

Bases: pygame_gui.core.UIContainer

General and abstract input with label and a value to write or select

Parameters:
  • relative_rect (pygame.Rect) – position and size of the input

  • manager (pygame_gui.core.interfaces.IUIManagerInterface) – Manager (from pygame_gui)

  • container (pygame_gui.core.interfaces.IContainerLikeInterface) – Container of the UIInput (form pygame_gui)

  • label_text (str) – Text of the label

  • waited_type (type) – Expected type of the value

  • error_resource (pygame.image) – Image displayed when an error occurs

font_info
waited_type

expected type of the input value

validated = True

is the input valid

error_pos

position and size of the error icon

label_pos

position of the label

_
error_image

error image displayed when an error occurs

error

ui image for error

abstract set_text(text)

Set the text of the input. To implement on subclasses. :param text: Text of the input

Parameters:

text (str)

abstract get_text()

Set the text of the input. To implement on subclasses.

Returns:

Text of the input

Return type:

str

update(time_delta)

Update on validating value input

Parameters:

time_delta (float) – Time passed since the last call

validate()

Validate if the value of the UIInput respects some constraints

Returns:

True if the value is valid

Return type:

bool