Name

setResizable()

Description

By default, Processing sketches can't be resized. When surface.setResizable(true) is used within a sketch, the window can be resized while it's running.

There are more features of PSurface documented in the Processing JavaDoc.

Examples

  • void setup() {
      size(200, 200);
      surface.setTitle("Hello World!");
      surface.setResizable(true);
      surface.setLocation(100, 100);
    }
    
    void draw() {
      background(204);
      line(0, 0, width, height);
      line(width, 0, 0, height); 
    }
    

Syntax

  • surface.setResizable(resizable)

Parameters

  • resizableboolean: true to make the surface resizable

Return

  • void