Difference between revisions of "Back to the first frame"

From Interaction Station Wiki
Jump to navigation Jump to search
(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...")
 
 
Line 28: Line 28:
  
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
[[Category:Processing]]

Latest revision as of 09:38, 21 November 2022

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}