top of page
Check back soon
Once posts are published, you’ll see them here.

Processing random 畫

  • May 10, 2017
  • 2 min read

void setup() { size(700, 800); fill(255,255,215);//lightyellow rect(500, 0, 200, 800); fill(0); rect(525, 20, 150, 50);//next rect(525, 150, 150, 50);//pre rect(525, 280, 150, 50);//random rect(525, 430, 150, 50);//next rect(525, 560, 150, 50);//pre rect(525, 690, 150, 50);//random fill(255); textSize(20); text("Next",580,50);//next text("Previous",560,180);//previos text("Random",560,310);//random text("Next",580,460);//next text("Previous",560,590);//previos text("Save",580,720);//random frameRate(12); } int t = 1; int b = 1; int picCount = 20; void draw(){ //int front = int(random(1, picCount)); // Select the front card //int back = int(random(1, picCount)); // Select the back card println(mouseX + " : " + mouseY); PImage imgFront = loadImage(t + "t.jpg"); PImage imgBack = loadImage(b + "b.jpg"); image(imgFront, 0, 0); image(imgBack, 0, 400); if (mouseX >=525 && mouseX <= 675 && mouseY >=20 && mouseY <= 70 && mousePressed == true && mouseButton == LEFT) { if(t < picCount){ t++; }else{ t = 1; } }else if (mouseX >=525 && mouseX < 675 && mouseY >=150 && mouseY <= 200 && mousePressed == true && mouseButton == LEFT) { if(t > 1){ t--; }else{ t = picCount; } }else if (mouseX >=525 && mouseX < 675 && mouseY >=280 && mouseY <= 330 && mousePressed == true && mouseButton == LEFT) { t = int(random(1, picCount)); // Select the front card b = int(random(1, picCount)); // Select the back card }else if (mouseX >=525 && mouseX < 675 && mouseY >=430 && mouseY <= 480 && mousePressed == true && mouseButton == LEFT) { if(b < picCount){ b++; }else{ b = 1; } }else if (mouseX >=525 && mouseX < 675 && mouseY >=560 && mouseY <= 610 && mousePressed == true && mouseButton == LEFT) { if(t > 1){ b--; }else{ b = picCount; } }else if (mouseX >=525 && mouseX < 675 && mouseY >=690 && mouseY <= 740 && mousePressed == true && mouseButton == LEFT) { saveFrame("x-##.jpg");; //save } }


 
 
 

Comments


join us

 for the 

PARTY

Recipe Exchange @ 9pm!

start

 with 

Ubuntu

ubuntu   12.04

Linux 桌面系統
心得與筆記
  • 課程:Linux桌面系統

  • 系級:資管二甲

  • 姓名:蘇亭云

  • 學號:403401263.

Read More About me
Tag Cloud
Follow Me
  • Facebook - White Circle
  • Twitter - White Circle
  • Google+ - White Circle
  • YouTube - White Circle
  • Instagram - White Circle

© 2023 by My Weight Lost Journey. Proudly Created with Wix.com

bottom of page