草图重新启动后保存的记分板? - 处理

时间:2014-06-19 18:53:03

标签: processing

有没有办法在草图关闭并重新打开后在处理中创建记分板?有没有办法让这个工作在android?

1 个答案:

答案 0 :(得分:1)

这里有一个使用saveStrings()的小样本:

//random scores
int[] scores = {01,20,40,60,30,25};

void setup(){
  //convert and save
  String[] s = str(scores);
  saveStrings("sco.txt",s);

  //load in a different array...
  // the path to saved data, 
 String path = "/Users/vk/Documents/Processing/_forum/saveScore/sco.txt";
 int[] loadedScores = int(loadStrings(path));

 // ensure they are there...
 println(loadedScores);
}