Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
patchu54
patchu54's Profile
1
Posts
0
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
Need Help Please with mouseclicked
[1 Reply]
07-Feb-2013 08:37 PM
Forum:
Programming Questions
Hi I have been using processing for less than 5 months now and I am having trouble with a mouseclicked. When I mouse clicked it changes the background color but I want it to also call a draw of a circle in the sky. Help is appreciated :)
color sky = color(44, 128, 209);
void setup () {
size(800, 800);
//draws sky
background(sky);
}
void draw(){
//draws grass
fill(32, 245, 80);
noStroke();
//draw house
rect(0, 600, 800, 200);
fill(131,41,36);
rect(100,350,300,300);
fill(111,111,111);
triangle(50,350,250,250,450,350);
fill(111,111,111);
rect(200,500,100,150);
fill(0);
ellipse(280,585,15,15);
//draws windows
fill(255);
rect(150,390,75,75);
fill(255);
rect(275,390,75,75);
stroke(0);
line(187,390,187,465);
line(150,427,225,427);
line(312,390,312,465);
line(275,427,350,427);
fill(163,165,145);
ellipse(600,50,25,25);
//start Fence
translate(0,625);
int fenceW = 10;
int fenceH = 100;
//draws top horizontal board
rect(0, fenceH/4, width, fenceW);
//draws bottom horizontal board
rect(0,fenceH*3/4, width, fenceW);
//draws vertical fence boards
int fenceboard = 10;
while( fenceboard < width) {
rect(0,0,fenceW,fenceH);
line(0,0,fenceW/2,-fenceW/2);
line(fenceW,0,fenceW/2,-fenceW/2);
translate(fenceW*2,0);
fenceboard=fenceboard+fenceW*2;
}
}
void mouseClicked(){
background(0);
fill(255);
ellipse(600,50,25,25);
}
«Prev
Next »
Moderate user : patchu54
Forum