Hello everyone!
Currently working into a final project for my degree in media and cinema studies. For that I envisioned a video-installation that consists into two steps. At first, we have the user inputting information such as name, gender, age, nationality and so on (using Processing). While all this happens, I want to capture the camera signal and render the video for the second step. It would only happen once, in the beggining of the activation.
This next portion of the installation will display the info gathered into an array using treemap libraries, as well as the video captured (for this particular bit I planned into using Praxis Live software)
With all that said, my initial plan is to cover up single steps of code and try to merge them in the future. I’m currently struggling with different text boxes appearing as the user proceeds writing their info.
I managed to understand the basics of constructing textareas and textfields, but I can’t get my head around on how to hide or show them.
This is the piece of code I’m using to try and tackle this part of the project:
import controlP5.*;
ControlP5 cp5;
Button mouseClick;
Textarea myTextarea;
Textarea iniciar;
String textValue = "";
int state = 0;
void setup() {
size (500, 500);
//fullScreen();
noStroke();
cp5 = new ControlP5(this);
/*mouseClick = new Button(cp5, "clique aqui para continuar")
.setSize(100, 20)
.addCallback(new CallbackListener() {
public void controlEvent(CallbackEvent theEvent) {
if (theEvent.getAction()==ControlP5.ACTION_CLICK) {
state+=1;
println(state);
}
}
})
;*/
}
void draw() {
background(0);
switch (state) {
case 0:
splashText();
break;
case 1:
background(0);
cp5.get(Textarea.class, "titulo").setVisible(false);
cp5.get(Textarea.class, "clique").setVisible(false);
break;
}
}
void splashText() {
cp5 = new ControlP5(this);
myTextarea = cp5.addTextarea("titulo")
.setPosition(100, 100)
.setSize(400, 40)
.setFont(createFont("arial", 30))
.setLineHeight(14)
.setColor(color(128))
.setColorBackground(color(185, 100))
.setColorForeground(color(255, 100))
;
myTextarea.setText("enTro"
);
iniciar = cp5.addTextarea("clique")
.setPosition(280, 295)
.setSize(200, 25)
.setFont(createFont("arial", 12))
.setLineHeight(14)
.setColor(color(135))
.setColorBackground(color(198, 100))
.setColorForeground(color(255, 100))
;
iniciar.setText("clique para continuar..."
);
}
public void nome() {
cp5 = new ControlP5(this);
cp5.addTextfield("nome")
.setPosition(100, 100)
.setSize(200, 40)
.setFont(createFont("arial", 12))
.setColor(color(128))
.setColorBackground(color(185, 100))
.setFocus(true)
.setAutoClear(false)
;
}
public void idade() {
}
void mouseClicked() {
int i = 0;
if (i <= state)
{
if (state < 2)
{
state++;
i++;
println(state);
}
else {
state = 0;
println("reset");
}
}
}
I have some more questions with the other bits of the project, but I’ll try to focus into one issue at a time.
every opinion to me is really important, thanks in advance!