2016-02-28 21 views
1

可能很愚蠢的问题,但这是可能的或不在p5js?p5js button.mousePressed调用函数+参数?

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

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

非常感谢!

回答

0

使用

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