Name

fullScreen()

Examples
# Run the code at the full dimensions of the screen currently
# selected inside the Preferences window

x = 0

def setup():
    fullScreen()
    background(0)
    noStroke()
    fill(102)

def draw():
    global x
    rect(x, height*0.2, 1, height*0.6)
    x = x + 2
# If more than one screen is attached to the computer, run the 
# code at the full dimensions on the screen defined by the 
# parameter to fullScreen()

x = 0

def setup():
    fullScreen(2)
    background(0)
    noStroke()
    fill(102)

def draw():
    global x
    rect(x, height*0.2, 1, height*0.6)
    x = x + 2
# Run full screen using the P2D renderer on screen 2

x = 0

def setup():
    fullScreen(P2D, 2)
    background(0)
    noStroke()
    fill(102)

def draw():
    global x
    rect(x, height*0.2, 1, height*0.6)
    x = x + 2
# If more than one screen is attached to the computer, run the 
# code at the full dimensions across all of the attached screens

x = 0

def setup():
  fullScreen(P2D, SPAN)
  background(0)
  noStroke()
  fill(102)

def draw():
  rect(x, height*0.2, 1, height*0.6)
  x = x + 2
Description This function is new for Processing 3.0. It opens a sketch using the full size of the computer's display. This function must be the first line in setup(). The size() and fullScreen() functions cannot both be used in the same program, just choose one.

When fullScreen() is used without a parameter, it draws the sketch to the screen currently selected inside the Preferences window. When it is used with a single parameter, this number defines the screen to display to program on (e.g. 1, 2, 3...). When used with two parameters, the first defines the renderer to use (e.g. P2D) and the second defines the screen. The SPAN parameter can be used in place of a screen number to draw the sketch as a full-screen window across all of the attached displays if there are more than one.

Prior to Processing 3.0, a full-screen program was defined with size(displayWidth, displayHeight).

Updated on Tue Feb 27 14:07:12 2024.

If you see any errors or have comments, please let us know.