window_resizable()

Set the Sketch window as resizable by the user.

Examples

1
2
3
4
5
6
def setup():
    py5.window_resizable(True)


def draw():
    py5.square(py5.random(py5.width), py5.random(py5.height), 10)

Description

Set the Sketch window as resizable by the user. The user will be able to resize the window in the same way as they do for many other windows on their computer. By default, the Sketch window is not resizable.

Changing the window size will clear the drawing canvas. If you do this, the width and height variables will change.

This method provides the same funcationality as Py5Surface.set_resizable() but without the need to interact directly with the Py5Surface object.

Underlying Processing method: windowResizable

Syntax

window_resizable(resizable: bool, /) -> None

Parameters

  • resizable: bool - should the Sketch window be resizable

Updated on February 10, 2022 17:53:01pm UTC