Mixing two program
in
Contributed Library Questions
•
1 year ago
Hello there! I'm trying for the moment, to make a new program.... BUT... I don't know how to launch two software on one program....
Would you please, just tell me how i can do it
(sorry for my english, i'm french).
Thanks to all (sorry, i know that's a stupid question).
Here, the code :
code 1 :
- import controlP5.*;
- ControlP5 cp5;
- int myColor = color(255);
- int c1,c2;
- float a,a1;
- void setup() {
- size(400,600);
- noStroke();
- cp5 = new ControlP5(this);
- // create a new button with name 'buttonA'
- cp5.addButton("RESEAU 4D")
- .setValue(0)
- .setPosition(100,100)
- .setSize(200,19)
- ;
- }
- void draw() {
- background(myColor);
- myColor = lerpColor(c1,c2,a);
- }
- public void controlEvent(ControlEvent theEvent) {
- println(theEvent.getController().getName());
- a = 0;
- }
- // function colorA will receive changes from
- // controller with name colorA
- public void colorA(int theValue) {
- println("a button event from colorA: "+theValue);
- c1 = c2;
- c2 = color(0,160,100);
- }
And the second after
1