可能是愚蠢的问题,但这在p5js中是否可行?

function setup() {
   myButton.mousePressed(toggleVideo(1)); //This toggleVideo works well without argument
}

function toggleVideo(v) {
    blablabla[v].loop();
}


非常感谢!

最佳答案



mousePressed(function() { toggleVideo(1);});

10-06 07:42