Function does not exist error
in
Programming Questions
•
3 years ago
I keep getting error message "The function draw(PGraphics) does not exist." New at this and not sure what I'm missing... I appreciate your help!
import processing.opengl.*;
import geomerative.*;
import processing.pdf.*;
float toldist;
RFont f;
RGroup grupo;
boolean restart = false;
Particle[] psys;
int numPoints, numParticles;
float maxvel;
//------------------------ Runtime properties ----------------------------------
// Save each frame
boolean SAVEVIDEO = false;
boolean SAVEFRAME = false;
boolean APPLICATION = true;
String DEFAULTAPPLETRENDERER = P3D;
int DEFAULTAPPLETWIDTH = 800;
int DEFAULTAPPLETHEIGHT = 800;
String DEFAULTAPPLICRENDERER = OPENGL;
int DEFAULTAPPLICWIDTH = 800;
int DEFAULTAPPLICHEIGHT = 800;
//------------------------------------------------------------------------------
// Text to be written
String STRNG = "B";
// Font to be used
String FONT = "arial.ttf";
// Velocity of change
int VELOCITY = 1;
// Velocity of deformation
float TOLCHANGE = 0.0001;
// Coefficient that handles the variation of amount of ink for the drawing
float INKERRCOEFF = 0.001;
// Coefficient that handles the amount of ink for the drawing
float INKCOEFF = 0.1;
// Coefficient of precision: 0 for lowest precision
float PRECCOEFF = 4;
String newString = "";
int Start_Second;
int Gray1 = 150;
int Gray2 = 150;
int Gray3 = 150;
color Color_Index[]={
#e02892, #9a3594, #0094d8, #3f9a5a, #f5851f, #ed1c24};
int Mood_Trigger[] = {
0,0,0,0,0,0 };
int Active_Color =0;
int Alpha = 200;
int widthdistancia;
void setup(){
int w = DEFAULTAPPLICWIDTH, h = DEFAULTAPPLICHEIGHT;
String r = DEFAULTAPPLICRENDERER;
if(!APPLICATION){
// Specify the width and height at runtime
w = int(param("width"));
h = int(param("height"));
r = (String)param("renderer");
// (String) will return null if param("renderer") doesn’t exist
if (r != OPENGL && r != P3D && r != JAVA2D && r != P2D) {
r = DEFAULTAPPLETRENDERER;
}
// int() will return 0 if param("width") doesn’t exist
if (w <= 0) {
w = DEFAULTAPPLETWIDTH;
}
// int() will return 0 if param(“height”) doesn’t exist
if (h <= 0) {
h = DEFAULTAPPLETHEIGHT;
}
}
size(w,h,r);
frameRate(35);
try{
smooth();
}
catch(Exception e){
}
background(255);
RG.init(this);
widthdistancia = 10;
f = new RFont(this.FONT,72,RFont.CENTER);
initialize();
Start_Second = second();
beginRecord(PDF, "everything.pdf");
}
void draw(){
pushMatrix();
translate(width/2, height/2);
noStroke();
for(int i=0;i<numParticles;i++){
for(int j=0;j<VELOCITY;j++){
psys[i].update(grupo);
psys[i].draw(g);
}
}
popMatrix();
toldist =1;
}
.....
2