This reference is for Processing 3.0+. If you have a previous version, use the reference included with your software in the Help menu. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.

Name

setLocation()

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); 
}
Description The setLocation() function defines the position of the Processing sketch in relation to the upper-left corner of the computer screen.

There are more features of PSurface documented in the Processing JavaDoc.
Syntax
surface.setLocation(x, y)
Parameters
x int: x-coordinate of the surface
y int: y-coordinate of the surface
Updated on January 1, 2021 03:38:12am EST