2016-02-28 54 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);});