text input/video array
in
Core Library Questions
•
1 year ago
Say I have a blank string for input of user text. Say I have an array of video files.
Now say I want to link each of these mov files to their respective key. When the user types something out and presses Enter, a new mov file if created, which consists of all that concatenated info. I've searched some previous topics on this issue, but I'm still unable to get this to work. Full code so far below:
Now say I want to link each of these mov files to their respective key. When the user types something out and presses Enter, a new mov file if created, which consists of all that concatenated info. I've searched some previous topics on this issue, but I'm still unable to get this to work. Full code so far below:
- import processing.video.*;
String tempWord="";
Movie[] movies= new Movie[3];
void setup()
{
size(640, 480);
movies[0]= new Movie(this, "A.mov");
movies[1]= new Movie(this, "B.mov");
movies[2]= new Movie(this, "C.mov");
}
void draw()
{
background(0);
textAlign(CENTER);
text(tempWord, width/2, height/2);
image(movies[0], 0, 0);
}
void movieEvent (Movie m)
{
m.read();
}
void keyPressed()
{
if (key==ENTER)
{
tempWord="";
if (key=='a')
{
movies[0].play();
}
}
else
{
tempWord+= key;
}
}
1