有一种方法可以重置(更改)方法void mouseClicked()
的代码,最初在代码中定义,在if(条件)验证后?处理 - 更改mouseClicked()代码
例如: 如果我有:
void mouseClicked(){
print("clicked1");
}
void draw(){
if(frameRate>=1000) ---->
//redefine mouseClicked() method so that it will do
exit();
}
有很多方法可以改变程序的行为,但是你的代码不足以给你很好的建议。请创建一个[mcve]。 – RealSkeptic
你是否在寻找像这样的东西http://stackoverflow.com/questions/11749409/replace-content-of-some-methods-at-runtime – Bha1