Hi folks
I try to turn a normal sketch into a MPE (most pixels ever library) compatible one. The display get filled by horizontal color stripes of 10pix height. When the stripes reache the bottom of the display the whole image should shift up to make space for a new stripe (and so on). To shift up the whole image i manipulate the pixels Array of the display (see code below).
In a normal sketch this works great, but by using the MPE framework the animation freezes when executing this part of the code. Is it basicaly possible to manipulate the pixels array in a MPE sketch, or do I have to broadcast the hole display from client one to the other clients? And, is a array of the whole screen not to big to be broatcasted over the network? I use 3 screens on a resolution of 1024x768 pixels.
the code in the MPE file:
Code:
if(yTxt > client.getM()){
loadPixels();
for(int i = 0; i < client.getMWidth()*client.getMHeight(); i++){
if(i < (client.getMWidth()*client.getMHeight())-(10*client.getMWidth())){
pixels[i] = pixels[i+(client.getMWidth()*10)];
}
else{
colorMode(RGB, 255);
pixels[i] = color(255);
}
}
updatePixels();
yTxt -= 10;
}
the code in the normal file:
Code:
if(yTxt > height){
loadPixels();
for(int i = 0; i < width*height; i++){
if(i < (width*height)-(10*width)){
pixels[i] = pixels[i+(width*10)];
}
else{
colorMode(RGB, 255);
pixels[i] = color(255);
}
}
updatePixels();
yTxt -= 10;
}
I already tried to put the whole array into an array of a PImage on client one, to broatcast this picture afterward and place it in the other clients, but it didn't work. If somebody could explain to me how broadcasting works exactly, it would be grate. Or, if somone knows an other solution to shift up the hole display by 10pix and insert a white space, I would be glad to learn it
I hope this was understandable, if you have any additional questions, just ask.
thanks in advance Thomas