this is my first program i've written so far. i'm trying to control a movie through the keyboard. i'd like to flash blank screens in monochrome color, control the fps, and 4 channels of ARGB.
below is my code:
import processing.video.*;
Movie pttp;
int value = 0;
int z = 255;
int newz = constrain(value, 0, 255);
int x = 255;
int newx;
int c = 255;
int newc;
int v = 255;
int newv;
PImage img;
void setup() {
size(960,540,P2D);
frameRate(24);
pttp = new Movie(this, "prototype.mov");
pttp.loop();
}
void draw() {
if(keyPressed) {
if (key == 'z') {
newz = z;
z-=10;
}
if (key == 'a') {
newz = z;
z+=10;
}
if (key == 'x') {
newx = x;
x-=10;
}
if (key == 's') {
newx = x;
x+=10;
}
if (key == 'c') {
newc = c;
c-=10;
}
if (key == 'd') {
newc = c;
c+=10;
}
if (key == 'v') {
newv = v;
v-=10;
}
if (key == 'f') {
newv = v;
v+=10;
}
if (key == 'g') {
background(0,200,0);
}
}
tint(newz,newx,newc,newv);
image(pttp, 0, 0, width, height);
println(newz);
}
if (key == 'g') {
background(0,200,0);
}
i've inserted the above for controlling the background, but nothing changes in that setting. i've tried rect() but yield the same results. in short, i'm trying to get a function that would washout the whole screen into a color whenever a key is pressed.
as for framerates, i've written the below to control it. i've tried moving it around under draw and setup, but this ruins everything and doesn't allow the prior settings to function (ARGB channel).
if (key == 'y') {
newy = y;
y+=5;
}
if (key == 'h') {
newy = y;
y-=5;
}
frameRate(newy);
as for the 4 channels of ARGB, they are working the way i want but can't constrain them within 0-255 boundaries. i've tried both constrain() and map(), but is very confused about the map() values. with both methods the numbers still go pass 0-255.
sorry for the many questions, but your help would be very appreciated!