I’m making an Android app using Processing, and have decided to port my code to Eclipse. I guess there are a lot of differences between Processing and pure Java, because right off the bat I am getting errors that make little sense to me. For example:
int inactiveThreshold = 300 + int(random(-100, 100));
int randomPointInterval = int(random(300, 500));
I get the error “Syntax error on token “int”, delete this token”
As for the random function, I extend PApplet and have imported processing.core.* so I don’t see why that wouldn’t work properly.
Also getting errors on anything referencing a color that I created:
back.drawBackground("shadow", backgroundColor);
back.drawBackground("front", backgroundColor);
“Color cannot be resolved to a type”, despite initializing backgroundColor as an integer:
int backgroundColor = color(100, 100, 120);
There’s also a function in the main class that handles mouse movement, and when I make a reference to it says that the function is undefined.
These errors are just in the main class, so I figured I should tackle that before anything else. I’ve mainly been following this for porting the code:
http://www.learningprocessing.com/tutorials/processing-in-eclipse/
I haven’t done much in pure Java so there are probably a lot of differences that Processing’s precompiler handles that I’m not noticing.
For int casting: do
For randoms:
Any time you see java.blah.ClassName, you can do this so it’s not cluttered with java.blah qualifiers.