Window

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.