"function does not exist" error
in
Programming Questions
•
1 year ago
I created a Title class with the constructor Title(String, int, int), but when I try to construct a Title I get the error "The function Title(String, int, int) does not exist." I have checked and re-checked my curly brackets to make sure I don't have any dangling open brackets that might cause an error like this, and I can't find any. Not even a missing semicolon (for once in my life). Can anyone think of something else that might cause an error like this? Here's my code for the Title class:
- class Title{
String title;
int currentX, currentY, endX, endY, changeX, changeY;
boolean titleDraw;
int titleSize = 100;
int sizeChange = 4;
PFont thinFont;
Title(String t, int eX, int eY){
title = t;
endX = eX;
endY = eY;
currentX = width/2;
currentY = height/2;
changeX = (currentX-endX)/50;
changeY = (currentY-endY)/50;
titleDraw = false;
thinFont = loadFont("ArialMT-100.vlw");
}
void draw(){
if(titleDraw){
textFont(thinFont, titleSize);
text(title, currentX, currentY);
if(((currentX != endX+10)&&(currentX != endX=10))||(currentY!=endY+10)&&(currentY!=endY-10)){
currentX -= changeX;
currentY -= changeY;
}
if(titleSize <= 200){
titleSize+=sizeChange;
}
else sizeChange = -4;
}
}
}
1