我有這個處理應用程序,其中包含2個功能。第一個稱爲loadScreen。第二個叫做mainMenu。當應用程序初始化時,它會調用函數「loadScreen();」。我在這個功能裏面設置了一個定時器,這樣在5秒鐘後,它會跳到「mainMenu」。問題是如何停止我的功能並調用另一個函數?有沒有「休息」?或「停止」功能,我可以使用?謝謝!處理 - 啓動功能和停止功能
void loading() { //Code to load start screen
if (millis() - time >= wait) {
time = millis();//also update the stored time
image(loadingImage, 0, 0);
}
if (time/1000 == 5) {
time=5000; // Stop here
startMenu();
}
}
void startMenu() {
//Code to load the real game
text("Start", 350, 300);
}
你能編輯你的文章添加代碼嗎?這將允許更好的答案。 – araknoid 2013-03-01 11:35:46
告訴我們關於平臺和你有什麼限制的一些事情。 – boutta 2013-03-01 13:53:44