xxxxxxxxxx
void setup() {
size(1000, 680);
frameRate(100);
background(255);
}
float r=0;
float g=0;
float b=0;
float Size=10;
float circle=0;
float page=2;
void draw() {
line(0,0,1000,0);
line(0,0,0,700);
fill(100);
rect(0, 500, 1000, 200);
fill(255, 0, 0);
if (page==1)
{
fill(255, 64, 0);
}
if (page==2)
{
fill(255, 196, 0);
}
ellipse(50, 650, 50, 50);
if (circle==0)
{
rect(25, 625, 50, 50);
}
fill(0, 255, 0);
if (page==1)
{
fill(255, 0, 64);
}
if (page==2)
{
fill(255, 0, 196);
}
ellipse(150, 650, 50, 50);
if (circle==0)
{
rect(125, 625, 50, 50);
}
fill(0, 0, 255);
if (page==1)
{
fill(255, 64, 64);
}
if (page==2)
{
fill(255, 196, 196);
}
ellipse(250, 650, 50, 50);
if (circle==0)
{
rect(225, 625, 50, 50);
}
fill(255, 255, 0);
if (page==1)
{
fill(64, 255, 0);
}
if (page==2)
{
fill(196, 255, 0);
}
ellipse(75, 600, 50, 50);
if (circle==0)
{
rect(50, 575, 50, 50);
}
fill(255, 0, 255);
if (page==1)
{
fill(0, 255, 64);
}
if (page==2)
{
fill(0, 255, 196);
}
ellipse(175, 600, 50, 50);
if (circle==0)
{
rect(150, 575, 50, 50);
}
fill(0, 255, 255);
if (page==1)
{
fill(64, 255, 64);
}
if (page==2)
{
fill(196, 255, 196);
}
ellipse(275, 600, 50, 50);
if (circle==0)
{
rect(250, 575, 50, 50);
}
fill(255, 128, 0);
if (page==1)
{
fill(64, 0, 255);
}
if (page==2)
{
fill(196, 0, 255);
}
ellipse(350, 650, 50, 50);
if (circle==0)
{
rect(325, 625, 50, 50);
}
fill(255, 0, 128);
if (page==1)
{
fill(0, 64, 255);
}
if (page==2) {
fill(0, 196, 255);
}
ellipse(450, 650, 50, 50);
if (circle==0)
{
rect(425, 625, 50, 50);
}
fill(128, 255, 0);
if (page==1)
{
fill(64, 64, 255);
}
if (page==2) {
fill(196, 196, 255);
}
ellipse(550, 650, 50, 50);
if (circle==0)
{
rect(525, 625, 50, 50);
}
fill(0, 255, 128);
if (page==1)
{
fill(255, 128, 128);
}
if (page==2)
{
fill(230, 230, 255);
}
ellipse(375, 600, 50, 50);
if (circle==0)
{
rect(350, 575, 50, 50);
}
fill(128, 0, 255);
if (page==1)
{
fill(128, 255, 128);
}
if (page==2)
{
fill(255, 250, 240);
}
ellipse(475, 600, 50, 50);
if (circle==0)
{
rect(450, 575, 50, 50);
}
fill(0, 128, 255);
if (page==1)
{
fill(128, 128, 255);
}
if (page==2)
{
fill(240, 248, 255);
}
ellipse(575, 600, 50, 50);
if (circle==0)
{
rect(550, 575, 50, 50);
}
fill(0);
if (page==1)
{
fill(64);
}
if (page==2)
{
fill(255, 255, 240);
}
ellipse(650, 650, 50, 50);
if (circle==0)
{
rect(625, 625, 50, 50);
}
fill(255);
if (page==1)
{
fill(196);
}
if (page==2)
{
fill(240, 255, 255);
}
ellipse(675, 600, 50, 50);
if (circle==0)
{
rect(650, 575, 50, 50);
}
fill(r, g, b);
ellipse(775, 625, 50, 50);
if (circle==0)
{
rect(750, 600, 50, 50);
}
ellipse(820, 625, 25, 25);
if (circle==0)
{
rect(807.5, 612.5, 25, 25);
}
ellipse(850, 625, 20, 20);
if (circle==0)
{
rect(840, 615, 20, 20);
}
ellipse(875, 625, 15, 15);
if (circle==0)
{
rect(867.5, 617.5, 15, 15);
}
ellipse(890, 625, 10, 10);
if (circle==0)
{
rect(885, 620, 10, 10);
}
ellipse(900, 550, 50, 50);
rect(800, 525, 50, 50);
fill(200);
if (page==0) {
fill(0);
}
ellipse(200, 530, 40, 40);
fill(200);
if (page==1) {
fill(0);
}
ellipse(250, 530, 40, 40);
fill(200);
if (page==2) {
fill(0);
}
ellipse(300, 530, 40, 40);
}
void mouseClicked() {
noStroke();
if ((mouseX>25) && (mouseX<75) && (mouseY<675) && (mouseY>625))
{
r=255;
g=0;
b=0;
if (page==1)
{
r=255;
g=64;
b=0;
}
if (page==2)
{
r=255;
g=196;
b=0;
}
}
if ((mouseX>125) && (mouseX<175) && (mouseY<675) && (mouseY>625))
{
r=0;
g=255;
b=0;
if (page==1)
{
r=255;
g=0;
b=64;
}
if (page==2)
{
r=255;
g=0;
b=196;
}
}
if ((mouseX>225) && (mouseX<275) && (mouseY<675) && (mouseY>625))
{
r=0;
g=0;
b=255;
if (page==1)
{
r=255;
g=64;
b=64;
}
if (page==2)
{
r=255;
g=196;
b=196;
}
}
if ((mouseX>325) && (mouseX<375) && (mouseY<675) && (mouseY>625))
{
r=255;
g=128;
b=0;
if (page==1)
{
r=64;
g=0;
b=255;
}
if (page==2)
{
r=196;
g=0;
b=255;
}
}
if ((mouseX>425) && (mouseX<475) && (mouseY<675) && (mouseY>625))
{
r=255;
g=0;
b=128;
if (page==1)
{
r=0;
g=64;
b=255;
}
if (page==2)
{
r=0;
g=196;
b=255;
}
}
if ((mouseX>525) && (mouseX<575) && (mouseY<675) && (mouseY>625))
{
r=128;
g=255;
b=0;
if (page==1)
{
r=64;
g=64;
b=255;
}
if (page==2)
{
r=196;
g=196;
b=255;
}
}
if ((mouseX>625) && (mouseX<675) && (mouseY<675) && (mouseY>625))
{
r=0;
g=0;
b=0;
if (page==1)
{
r=64;
g=64;
b=64;
}
if (page==2)
{
r=240;
g=255;
b=255;
}
}
if ((mouseX>50)&&(mouseX<100)&&(mouseY>575)&&(mouseY<625))
{
r=255;
g=255;
b=0;
if (page==1)
{
r=64;
g=255;
b=0;
}
if (page==2)
{
r=196;
g=255;
b=0;
}
}
if ((mouseX>150)&&(mouseX<200)&&(mouseY>575)&&(mouseY<625))
{
r=255;
g=0;
b=255;
if (page==1)
{
r=0;
g=255;
b=64;
}
if (page==2)
{
r=0;
g=255;
b=196;
}
}
if ((mouseX>250)&&(mouseX<300)&&(mouseY>575)&&(mouseY<625))
{
r=0;
g=255;
b=255;
if (page==1)
{
r=64;
g=255;
b=64;
}
if (page==2)
{
r=196;
g=255;
b=196;
}
}
if ((mouseX>350)&&(mouseX<400)&&(mouseY>575)&&(mouseY<625))
{
r=0;
g=255;
b=128;
if (page==1)
{
r=255;
g=128;
b=128;
}
if (page==2)
{
r=230;
g=230;
b=250;
}
}
if ((mouseX>450)&&(mouseX<500)&&(mouseY>575)&&(mouseY<625))
{
r=128;
g=0;
b=255;
if (page==1)
{
r=128;
g=255;
b=128;
}
if (page==2)
{
r=255;
g=250;
b=240;
}
}
if ((mouseX>550)&&(mouseX<600)&&(mouseY>575)&&(mouseY<625))
{
r=0;
g=128;
b=255;
if (page==1)
{
r=128;
g=128;
b=255;
}
if (page==2)
{
r=240;
g=248;
b=255;
}
}
if ((mouseX>650)&&(mouseX<700)&&(mouseY>575)&&(mouseY<625))
{
r=255;
g=255;
b=255;
if (page==1)
{
r=196;
g=196;
b=196;
}
if (page==2)
{
r=255;
g=255;
b=240;
}
}
if ((mouseX>750)&&(mouseX<800)&&(mouseY>600)&&(mouseY<650))
{
Size=50;
}
if ((mouseX>807.5)&&(mouseX<832.5)&&(mouseY>612.5)&&(mouseY<637.5))
{
Size=25;
}
if ((mouseX>845)&&(mouseX<855)&&(mouseY>620)&&(mouseY<630))
{
Size=20;
}
if ((mouseX>867.5)&&(mouseX<882.5)&&(mouseY>617.5)&&(mouseY<622.5))
{
Size=15;
}
if ((mouseX>885)&&(mouseX<895)&&(mouseY>620)&&(mouseY<630))
{
Size=10;
}
if ((mouseX>800)&&(mouseX<850)&&(mouseY>525)&&(mouseY<575))
{
circle=0;
}
if ((mouseX>875)&&(mouseX<925)&&(mouseY>525)&&(mouseY<575))
{
circle=1;
}
if ((mouseX>180)&&(mouseX<220)&&(mouseY>510)&&(mouseY<550))
{
page=0;
}
if ((mouseX>230)&&(mouseX<270)&&(mouseY>510)&&(mouseY<550))
{
page=1;
}
if ((mouseX>280)&&(mouseX<320)&&(mouseY>510)&&(mouseY<550))
{
page=2;
}
ellipse(900, 550, 50, 50);
rect(800, 525, 50, 50);
fill(r, g, b);
if (mouseY<500) {
if (circle==1) {
ellipse(mouseX, mouseY, Size, Size);
} else {
rect(mouseX-.5*Size, mouseY-.5*Size, Size, Size);
}
}
}
void mouseDragged() {
noStroke();
fill(r, g, b);
if (mouseY<500) {
if (circle==1) {
ellipse(mouseX, mouseY, Size, Size);
} else {
rect(mouseX-.5*Size, mouseY-.5*Size, Size, Size);
}
}
}