Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
chongyu.tu
chongyu.tu's Profile
2
Posts
6
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Pedometer?
[1 Reply]
05-Apr-2013 03:51 AM
Forum:
Android Processing
Morning Geeks!
Anyone have made any pedometer on Android via Processing?
I've searched in/outside this forum but didn't find any example.
Cheers!
I want to make a photo slideshow
[11 Replies]
01-Apr-2013 07:16 AM
Forum:
Programming Questions
Hi geeks!
I tried to make a photo slideshow with some button functions,
but there is some problem with it.
I don't know why.
Could anyone have a look at this. I don't think its a complex problem.
Thanks!
Here is the code:
boolean isImage3= false;
boolean isImage2= false;
boolean isImage1= true;
PImage img1;
PImage img2;
PImage img3;
void setup(){
size(500, 500);
img1 = loadImage("1.jpg");
img2 = loadImage("2.jpg");
img3 = loadImage("3.jpg");
}
void draw(){
background(255);
if(isImage1){
image1();
}
else if(isImage2){
image2();
}
else if(isImage3){
image3();
}
}
void image1(){
image(img1, 0, height/6,640,360);
fill(150);
rect(20,height/2,20,50);
rect(width-40,height/2,20,50);
}
void image2(){
image(img2, 0, height/6,640,360);
fill(150);
rect(20,height/2,20,50);
rect(width-40,height/2,20,50);
}
void image3(){
image(img3, 0, height/6,640,360);
fill(150);
rect(20,height/2,20,50);
rect(width-40,height/2,20,50);
}
void mousePressed(){
if(isImage1){
if(mouseX > 20 && mouseX<40 && mouseY > height/2 && mouseY< height/2+50){
isImage1=false;
isImage3 =true;
}
else if(mouseX > width-40 && mouseX<width-20 && mouseY > height/2 && mouseY< height/2+50){
isImage1=false;
isImage2 =true;
}
//if images button is hit
else {
isImage1= true;
}
}
if(isImage2){
if(mouseX > 20 && mouseX<40 && mouseY > height/2 && mouseY< height/2+50){
isImage2=false;
isImage1 =true;
}
else if(mouseX > width-40 && mouseX<width-20 && mouseY > height/2 && mouseY< height/2+50){
isImage2=false;
isImage3 =true;
}
//if images button is hit
else {
isImage2= true;
}
}
if(isImage3){
if(mouseX > 20 && mouseX<40 && mouseY > height/2 && mouseY< height/2+50){
isImage3=false;
isImage2 =true;
}
else if(mouseX > width-40 && mouseX<width-20 && mouseY > height/2 && mouseY< height/2+50){
isImage3=false;
isImage1 =true;
}
//if images button is hit
else {
isImage3= true;
}
}
}
«Prev
Next »
Moderate user : chongyu.tu
Forum