Skip to content

Window

The text in the title bar and in the task bar.

Sets the window icon and returns True when it was applied.

  • icon_path (str | pygame.Surface): image file relative to the project folder, an already loaded surface, or '' to restore the engine’s own icon.

Sets the text in the title bar and in the task bar.

  • title (str): the new window title.

Moves the window to the centre of the primary monitor.

Size of the primary monitor as (width, height).

The position of the window’s top-left corner on the desktop as (x, y).

Current window size as (width, height).

Moves the window’s top-left corner on the desktop.

  • position ((int, int)): new top-left corner of the window.

Resizes the window. studio.get_screen() returns the new surface afterwards, so pass it on to studio.load_scene(); the scene keeps drawing from the canvas origin.

  • size ((int, int)): new window size.

True while the window is fullscreen.

True while the window can be resized by the user.

Minimises the window.

Switches to fullscreen or back to a window. Does nothing when the mode already matches.

  • enabled (bool): True = fullscreen, False = windowed.

Lets the user resize the window. The window is re-created, so studio.get_screen() returns the new surface; only the canvas is redrawn at the new size — the scene keeps drawing from the canvas origin. Resizing a fullscreen window keeps it fullscreen, and the screen size can still be changed with set_window_size().

  • enabled (bool): True allows resizing, False locks the size.

Flips the mode — handy for an F11 shortcut.

True while the screen saver is allowed.

True while the cursor is shown.

Allows or blocks the operating system’s screen saver while the game runs.

  • enabled (bool): True allows the screen saver, False blocks it.

Shows or hides the mouse cursor inside the window — useful for games played with the keyboard.

  • visible (bool): True shows the cursor, False hides it.

Warps the pointer to a position inside the window — for example to put it back in the centre after a round.

  • position ((int, int)): new pointer position inside the window.