Cannot find anything named "token"
in
Programming Questions
•
1 years ago
Hello everyone!
I'm new to the forum and relatively new to processing, just starting to get a bit more serious with it. I didn't know any Java before.
I'm getting a "Cannot find anything named "token" when running my sketch, and I can't figure it out by myself, so please help. I should say that I don't expect the sketch to run right now, as I didn't implement all class methods - I'm rather doing a show-me-whats-the-next-problem-style debugging approach to constructing the program.
What I have is a class (in a different file as setup() and draw() are, but I guess that shouldn't be a problem?):
which works as far as I can see. However, in draw(), when the line
gets read by Processing, it throws the error:
I'm clueless, since I thought I created "token" in setup(). Any clues?
I'm new to the forum and relatively new to processing, just starting to get a bit more serious with it. I didn't know any Java before.
I'm getting a "Cannot find anything named "token" when running my sketch, and I can't figure it out by myself, so please help. I should say that I don't expect the sketch to run right now, as I didn't implement all class methods - I'm rather doing a show-me-whats-the-next-problem-style debugging approach to constructing the program.
What I have is a class (in a different file as setup() and draw() are, but I guess that shouldn't be a problem?):
- class Token {
- float life;
- Token () {
- println("token creator");
- life = 30;
- }
- void display() {
- stroke(30, 100, 100);
- strokeWeight(3);
- fill(30, 60, 100);
- ellipse(mouseX, height-height/10, 10, 10);
- }
- }
- Token token = new Token();
which works as far as I can see. However, in draw(), when the line
- token.display();
gets read by Processing, it throws the error:
Cannot find anything named "token"
I'm clueless, since I thought I created "token" in setup(). Any clues?
1