Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

p5.js | noDebugMode() Function

  • Difficulty Level : Easy
  • Last Updated : 27 Apr, 2020

The noDebugMode() function in p5.js is used to disable the debug mode enabled by debugMode() function in a 3D sketch.

Syntax:

noDebugMode()

Parameters: This function does not accept any parameters.

Below example illustrates the noDebugMode() function in p5.js:

Example:




let newFont;
let debugModeDisabled = false;
  
function preload() {
  newFont = loadFont('fonts/Montserrat.otf');
}
  
function setup() {
  createCanvas(600, 300, WEBGL);
  textFont(newFont, 18);
  
  // Enable debug mode
  debugMode();
  
  disableDebugButton = createButton("Disable Debug Mode");
  disableDebugButton.position(20, 80);
  
  disableDebugButton.mouseClicked(() => {
    debugModeDisabled = true;
  });
}
  
function draw() {
  background('green');
  text("Click on the button to disable "
        + "the debug mode.", -250, -100);
  orbitControl();
  lights();
  
  // If checkbox is checked
  // Disable debug mode
  if (debugModeDisabled) {
    noDebugMode();
  }
  noStroke();
  sphere(80);
}

Output:
debugMode-toggle

Online editor: https://editor.p5js.org/

Environment Setup: https://www.geeksforgeeks.org/p5-js-soundfile-object-installation-and-methods/

Reference: https://p5js.org/reference/#/p5/noDebugMode

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!