Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
thatgirld
thatgirld's Profile
1
Posts
2
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
Multiple Shapes HELP!
[5 Replies]
12-May-2013 02:49 AM
Forum:
Programming Questions
hi
i'm new to procesing and i was wondering if you could help me with my code
i want my shape to be stored after i close the shape or right-click, so i can start making a new shape
something like this:
http://www.openprocessing.org/sketch/60524
could you please help me
kind regards,
diane
ArrayList point1 = new ArrayList();
void setup(){
size(1076,672);
smooth();
strokeWeight(2);
}
void draw(){
background(255);
beginShape();
fill(0,95);
for(int i = 0; i < point1.size(); i++){
vertex(((Point)point1.get(i)).x, ((Point)point1.get(i)).y);
}
endShape(CLOSE);
}
class Point {
int x, y;
Point(int a, int b) {
x = a;
y = b;
}
}
void mousePressed(){
if(mouseButton == LEFT){
point1.add(new Point(mouseX, mouseY));
}
}
«Prev
Next »
Moderate user : thatgirld
Forum