MCPcopy Index your code
hub / github.com/processing/processing / insertFrame

Method insertFrame

core/src/processing/core/PApplet.java:4006–4017  ·  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

4004 * intended to be the frame number.
4005 */
4006 public String insertFrame(String what) {
4007 int first = what.indexOf('#');
4008 int last = what.lastIndexOf('#');
4009
4010 if ((first != -1) && (last - first > 0)) {
4011 String prefix = what.substring(0, first);
4012 int count = last - first + 1;
4013 String suffix = what.substring(last + 1);
4014 return prefix + nf(frameCount, count) + suffix;
4015 }
4016 return what; // no change
4017 }
4018
4019
4020

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