MCPcopy Index your code
hub / github.com/benfry/processing4 / insertFrame

Method insertFrame

core/src/processing/core/PApplet.java:3599–3610  ·  view source on GitHub ↗

Check a string for #### signs to see if the frame number should be inserted. Used for functions like saveFrame() and beginRecord() to replace the # marks with the frame number. If only one # is used, it will be ignored, under the assumption that it's probably not intended to be the frame number.

(String what)

Source from the content-addressed store, hash-verified

3597 * intended to be the frame number.
3598 */
3599 public String insertFrame(String what) {
3600 int first = what.indexOf('#');
3601 int last = what.lastIndexOf('#');
3602
3603 if ((first != -1) && (last - first > 0)) {
3604 String prefix = what.substring(0, first);
3605 int count = last - first + 1;
3606 String suffix = what.substring(last + 1);
3607 return prefix + nf(frameCount, count) + suffix;
3608 }
3609 return what; // no change
3610 }
3611
3612
3613

Callers 4

saveFrameMethod · 0.95
beginRecordMethod · 0.95
beginRawMethod · 0.95
endDrawMethod · 0.80

Calls 1

nfMethod · 0.95

Tested by

no test coverage detected