p5.js noDebugMode() Function
Last Updated :
23 Aug, 2023
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);
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 (debugModeDisabled) {
noDebugMode();
}
noStroke();
sphere(80);
}
|
Output:
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
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...