right,thanks a lot guys.
now step-by-step im compicating the whole thing.
now im trying to change it into a multi-screen project,with the MPE library.
the simple
Code:
PImage[] myImageArray = new PImage[5];
void setup() {
size(1200,600);
background(10,10,10);
smooth();
}
void draw() {
imageMode (CENTER);
for (int i=0; i < myImageArray.length; i++) {
myImageArray [0] = loadImage( "two.jpg");
myImageArray [1] = loadImage( "three.jpg");
myImageArray [2] = loadImage( "four.jpg");
myImageArray [3] = loadImage( "five.jpg");
myImageArray [4] = loadImage( "six.jpg");
}
}
void mousePressed(){
image(myImageArray[(int)random(5)],width/4,height/2);
image(myImageArray[(int)random(5)],width-width/4,height/2);
}
to the multiple with MPE /not finished/:
Code:import mpe.client.*;
TCPClient client;
PImage[] myImageArray = new PImage[5];
void setup() {
client = new TCPClient(sketchPath("mpe.ini"), this);
size(client.getLWidth(), client.getLHeight());
background(10,10,10);
smooth();
client.start();
}
void frameEvent(TCPClient c) {
imageMode (CENTER);
for (int i=0; i < myImageArray.length; i++) {
myImageArray [0] = loadImage( "two.jpg");
myImageArray [1] = loadImage( "three.jpg");
myImageArray [2] = loadImage( "four.jpg");
myImageArray [3] = loadImage( "five.jpg");
myImageArray [4] = loadImage( "six.jpg");
}
}
void draw() {
}
void mousePressed(){
image(myImageArray[(int)random(5)],client.getMWidth()/4,client.getMHeight()/2);
image(myImageArray[(int)random(5)],client.getMWidth()-client.getMWidth()/4,client.getMHeight()/2);
}
however,im not sure how to set the code for the mousePressed to broadcast a message from one client to other clients.so when mouse pressed random pics will be displayed in all screens.
smthing with client.broadcast(); ??
can anyone help?
sorry for having so obvious questions,its the lack of experience.
thank you in advance..