scripts.engine.widgets package

Submodules

scripts.engine.widgets.panel module

class Panel(relative_rect: pygame.Rect, starting_layer_height: int, manager: pygame_gui.core.interfaces.manager_interface.IUIManagerInterface, *, element_id: str = 'panel', margins: Optional[Dict[str, int]] = None, container: Optional[pygame_gui.core.interfaces.container_interface.IContainerLikeInterface] = None, parent_element: Optional[pygame_gui.core.ui_element.UIElement] = None, object_id: Optional[Union[pygame_gui.core.ui_element.ObjectID, str]] = None, anchors: Optional[Dict[str, str]] = None, visible: int = 1)[source]

Bases: abc.ABC, pygame_gui.elements.ui_panel.UIPanel

process_event(event: pygame.event.Event)[source]

Gives UI Windows access to pygame events. Derived windows should super() call this class if they implement their own process_event method.

update(time_delta: float)[source]

Update based on current state and data. Run every frame.

scripts.engine.widgets.screen_message module

class ScreenMessage(rect: pygame.Rect, text: str, manager: pygame_gui.ui_manager.UIManager)[source]

Bases: pygame_gui.elements.ui_text_box.UITextBox

Show messages on the centre of the screen for a limited time

__init__(rect: pygame.Rect, text: str, manager: pygame_gui.ui_manager.UIManager)[source]

Initialize self. See help(type(self)) for accurate signature.

handle_events(event)[source]

Handle events created by this UI widget

update(time_delta: float)[source]

Update based on current state and data. Run every frame.

scripts.engine.widgets.window module

class Window(rect: pygame.Rect, manager: pygame_gui.core.interfaces.manager_interface.IUIManagerInterface, window_display_title: str = '', element_id: Optional[str] = None, object_id: Optional[Union[pygame_gui.core.ui_element.ObjectID, str]] = None, resizable: bool = False, visible: int = 1)[source]

Bases: abc.ABC, pygame_gui.elements.ui_window.UIWindow

abstract process_close_button()[source]

Process closure of a window. Must be overriden in subclass. Usual use is creation of an event.

Example

def process_close_button(self):
event = pygame.event.Event(EventType.GAME, subtype=GameEvent.EXIT_MENU,

menu=UIElement.ACTOR_INFO)

pygame.event.post(event)

process_event(event: pygame.event.Event)[source]

Gives UI Windows access to pygame events. Derived windows should super() call this class if they implement their own process_event method.

NOTE: Copied check for button close from pygame_gui UIWindow to allow overwriting use of close button.

update(time_delta: float)[source]

Update based on current state and data. Run every frame.

Module contents