Here are the tries that i have done these past days.
This is the basic code of the text in that appears in the programme. I wanted to get to do it so like when you click the mouse in one of the two options it appears the other texts but did not got the result i wanted and somehow maybe not understanding well the functions because I continue getting errors. Is basic without any style nor design.
The code at the moment:
String text1="Hello!";
String text2="...";
String text3="Hello~";
String text4="Did i catch you attention?";
String text5="Are you male or female?";
String text6="Male";
String text7="Female!";
String text8="None of the above";
String text9="Did you know that everyone shares something in common?";
String text10="All are humans";
String text11="Do you live or exist?";
String text12="Live";
String text13="Exist";
String text14="Live is being in the moment here and now";
String text15="Even if you exist will not have any meaning if you don't live";
String text16="So I propose you to do some challenge";
String text17="Light your own star of life";
String text18="This will consist in three challenges related to 3 colours that combined together will light your star";
String text19="Red";
String text20="Try to find someone who have something red and show it to the screen";
String text21="Blue";
String text22="Try to find someone who have something blue and show it to the screen";
String text23="Green";
String text24="Try to find someone who have something green and show it to the screen";
String text25= "Now all the colours put together creates a light";
String text26="And with the light the star will shine";
int value = 0;
void setup() {
size(600, 600);
}
void draw() {
background(0);
//first options
text (text1, 300,300);
textSize (45);
textAlign(CENTER);
tint(value);
text(text1,0,0);
//fade = false;
}
void mouseClicked() {
if (value == 1) {
text (text2,400,400);
text(text3,500,500);
} else {
value = 0;
}
pushMatrix();{
if (mousePressed){
text ("...",300,400);
} else {
text("Hello~",300,500);}
popMatrix(); }
//void mouseClicked() {
//*if (keyPressed==false){
// text ("...",400,400);
//if(keyPressed==true) { text2 = "Hello~"; }
// } else { text3 = "Hello~"; }
//for (int i = 5; i < height; i += 5) {
// text4 = "Did I catch your attention?";
//if (i < 35) {
// stroke(0); //...set the colour to black }
// line(30, i, 80, i); }
//text ("...", 300,400);
//text ("Hello~",300,500); }
}
Actually i was trying two types of changing the text, but one give me more errors while the other show the text but not in the way i would like to so i stoped using that one.
The other code :
String text1= "Hello!";
String text2="...";
String text3="Hello~";
String text4="Did i catch you attention?";
String text5="Are you male or female?";
String text6="Male";
String text7="Female!";
String text8="None of the above";
String text9="Did you know that everyone shares something in common?";
String text10="All are humans";
String text11="Do you live or exist?";
String text12="Live";
String text13="Exist";
String text14="Live is being in the moment here and now";
String text15="Even if you exist will not have any meaning if you don't live";
String text16="So I propose you to do some challenge";
String text17="Light your own star of life";
String text18="This will consist in three challenges related to 3 colours that combined together will light your star";
String text19="Red";
String text20="Try to find someone who have something red and show it to the screen";
String text21="Blue";
String text22="Try to find someone who have something blue and show it to the screen";
String text23="Green";
String text24="Try to find someone who have something green and show it to the screen";
String text25= "Now all the colours put together creates a light";
String text26="And with the light the star will shine";
int value = 0;
void setup(){
size(800, 800);
background(0);
}
void draw(){
if (moussePressed==false){
text1+=1;
print ("Hello!");
if(text1 > 670 ) { text1 = 670; } // back to start point
} else { text(" ",465,30); }
if (mousePressed){
if (key=='2'){
text1-=1;
if(text1 < 570) {
text1 = 570;
textSize(30);
textAlign(CENTER);
text(text2,550,75); }
}
}
if (mousePressed){
if (key=='9'){
text1-=1;
if(text1 < 572) {
text1=572;
textSize(30);
textAlign(CENTER);
text(text3,550,75); }
}
}
if (mousePressed){
if (key=='t'){
text1-=1;
if(text1 < 574) {
text1=574;
textSize(30);
textAlign(CENTER);
text(text4,550,75); }
}
}
if (mousePressed){
if (key=='h'){
text1-=1;
if(text1 < 576) {
text1=576;
textSize(30);
textAlign(CENTER);
text(text5,550,75); }
}
}
if (mousePressed){
if (key=='d'){
text1-=1;
if(text1 < 578) {
text1=578;
fill(255,0,0);
noStroke();
ellipse(450,160,10,10);
textSize(30);
textAlign(CENTER);
text(text6,550,75); }
}
}
if (mousePressed){
if (key=='0'){
text1-=1;
if(text1 < 577) {
text1=577;
textSize(30);
textAlign(CENTER);
text(text7,550,75); }
}
}
if (mousePressed){
if (key=='3'){
text1-=1;
if(text1 < 578) {
text1=578;
print("Hello~");
textSize(30);
textAlign(CENTER);
text(text8,550,75); }
}
}
}