p5.js中的noDebugMode()函數用於禁用3D草圖中由debugMode()函數啟用的調試模式。
用法:
noDebugMode()
參數:該函數不接受任何參數。
以下示例說明了p5.js中的noDebugMode()函數:
例:
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);
}
輸出:
在線編輯: https://editor.p5js.org/
環境設置: https://www.geeksforgeeks.org/p5-js-soundfile-object-installation-and-methods/
參考: https://p5js.org/reference/#/p5/noDebugMode
相關用法
- CSS url()用法及代碼示例
- p5.js nf()用法及代碼示例
- p5.js nfs()用法及代碼示例
- p5.js nfc()用法及代碼示例
- p5.js nfp()用法及代碼示例
- d3.js d3.hsl()用法及代碼示例
- d3.js d3.sum()用法及代碼示例
- PHP max( )用法及代碼示例
- p5.js mag()用法及代碼示例
- PHP min( )用法及代碼示例
- PHP Ds\Set xor()用法及代碼示例
注:本文由純淨天空篩選整理自sayantanm19大神的英文原創作品 p5.js | noDebugMode() Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。