Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App

Related Articles

p5.js | fullscreen() function

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The fullscreen() function in p5.js is used to get the current fullscreen state of the user’s browser window. If an argument is given, sets the sketch to fullscreen or not based on the value of the argument. If no argument is given, returns the current fullscreen state. Note that due to browser restrictions this can only be called on user input.



Parameters: The function does not accept any parameters.

Below program illustrates the fullscreen() function in p5.js:


function setup() {
    // Set the background color
function mousePressed() {
    // Set the value of fullscreen
    // into the variable
    let fs = fullscreen();
    // Call to fullscreen function

Before Clicking the screen:

After Clicking the screen:


My Personal Notes arrow_drop_up
Last Updated : 16 Apr, 2019
Like Article
Save Article
Similar Reads
Related Tutorials