Back to the first frame

From Interaction Station Wiki
Revision as of 18:13, 18 April 2021 by WangN (talk | contribs) (Created page with "<syntaxhighlight lang="java" line='line'> if (vals[0]>40){ imgInSeq= (imgInSeq+1) % numImages; }else{ imgInSeq=1; } </syntaxhighlight> and after each sound trigger, if...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
1if (vals[0]>40){
2imgInSeq= (imgInSeq+1) % numImages;
3}else{
4  imgInSeq=1;
5}


and after each sound trigger, if you want processing to finish playing the entire sequence before go back to the first frame:

you can take a look at this:

1if (vals[0]>40){
2imgInSeq= (imgInSeq+1) % numImages;
3}else{
4  if(imgInSeq>5 && imgInSeq<97){
5  imgInSeq= (imgInSeq+1) % numImages;
6}else{
7  imgInSeq=1;
8  }
9}