I have a buch of classes written by me I would like to reuse in my future projects. It will be great to do this just improting a custom library.
How should I do that? What should I know and from where should I start?
I read this page
https://code.google.com/p/processing/wiki/LibraryBasics but it looks a bit tricky to me? It seems I have to write it in java and compile some files... I'm not sure this is what I need. I just want to reuse some classes without copy/paste them every time :-/
I'm planning to write a basic synthesizer and I'd love to write it in Processing but I'm not sure it is possible. Do Processing provides a low level sound API or is there a library for this? If so where can I find documentation about it?
I have a class with a lot of attributes. Each of those attributes have a default value.
class MyClass{
int a1=1;
int a2=2;
int a3=3;
...
MyClass(){
//in this constructor no parameters are passed so every attribute keeps it's default value
}
}
Now I want to instantiate an object of this class by passing to the constructor only the parameters I want to be different from the default value.
MyClass mc = new MyClass(a1=100, a5=500); // I would like a constructor like this where I set the value to only some attributes of the class while others keep their default value
How should I do this? I hope I don't have to write a constructor for every combination of parameters :-/
As the title says, I would like to resize the display window during the execution.
In my program, every time I click on the window I can choose an image to display and I would like the display size fits every time the size of the image displayed.
Something like this:
PImage img;
void setup(){
pickImage();
}
void draw(){
}
void mousePressed(){
pickImage();
}
void pickImage(){
String path=selectInput();
img=loadImage(path);
size(img.width,img.height);
image(img,0,0,width,height);
}
But the display window size change only the first time! Any suggestions?
This way the player moves up if I keep pressed the UP key.
The problem is when I first hit the key, the player goes up by 5px, then WAITS a bit, and then continues to move up.
Why he waits? How can I fix it? I'm sure is an input issue not a programming error. Is there a way to say to Procesing I don't want that delay?