How to add text file?
in
Programming Questions
•
5 months ago
Hi,
how do I add a text file? I have this code:
PImage img;
PImage studio;
PImage story;
PImage year1;
PImage studioc;
PImage storyc;
PImage yearc;
PImage background;
void setup(){
size (850,638);
background(0);
img=loadImage("cortinaanimationfilms2.jpg");
image(img,0,0);
studio=loadImage("studio2.jpg");
story=loadImage("story2.jpg");
year1=loadImage("year2.jpg");
studioc=loadImage("studiocortina.jpg");
storyc=loadImage("storycortina.jpg");
yearc=loadImage("yearcortina.jpg");
background= img;
}
void draw(){
image(studioc,0,0,width,height);
image(storyc,0,0,width,height);
image(yearc,0,0,width,height);
image(background,0,0,width,height);
image(studio,200,500,100,80);
image(story,400,500,100,80);
image(year1,600,500,100,80);
}
void mousePressed(){
if(mouseX>200 && mouseX <300 && mouseY>500 && mouseY <580){
background=studioc;
} else if(mouseX > 400 && mouseX < 500 && mouseY > 500 && mouseY < 580){
background = storyc;
} else if (mouseX > 600 && mouseX < 700 && mouseY >500 && mouseY < 580) {
background = yearc;
}
}
--------------------------------------------
When I click on a button (for example 'studio') it appears a new background and I need that in that new background show me a text file that when I click it will appear the whole information.
Please help me.
how do I add a text file? I have this code:
PImage img;
PImage studio;
PImage story;
PImage year1;
PImage studioc;
PImage storyc;
PImage yearc;
PImage background;
void setup(){
size (850,638);
background(0);
img=loadImage("cortinaanimationfilms2.jpg");
image(img,0,0);
studio=loadImage("studio2.jpg");
story=loadImage("story2.jpg");
year1=loadImage("year2.jpg");
studioc=loadImage("studiocortina.jpg");
storyc=loadImage("storycortina.jpg");
yearc=loadImage("yearcortina.jpg");
background= img;
}
void draw(){
image(studioc,0,0,width,height);
image(storyc,0,0,width,height);
image(yearc,0,0,width,height);
image(background,0,0,width,height);
image(studio,200,500,100,80);
image(story,400,500,100,80);
image(year1,600,500,100,80);
}
void mousePressed(){
if(mouseX>200 && mouseX <300 && mouseY>500 && mouseY <580){
background=studioc;
} else if(mouseX > 400 && mouseX < 500 && mouseY > 500 && mouseY < 580){
background = storyc;
} else if (mouseX > 600 && mouseX < 700 && mouseY >500 && mouseY < 580) {
background = yearc;
}
}
--------------------------------------------
When I click on a button (for example 'studio') it appears a new background and I need that in that new background show me a text file that when I click it will appear the whole information.
Please help me.
1