Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup
- {
- d = createShape(); // d is a PShape
- d.beginShape();
- fill(100);
- rect(200,200,200,200);
- d.endShape(CLOSE);
- d.disableStyle()
- }
- void draw()
- {
- shape(d, 300, 250);
- if ( mouseX >= 0 && mouseX <= 600 && mouseY >=0 && mouseY <= 600 )
- {
- greenC = true; //a boolean
- }
- }
- public void mousePressed()
- {
- if ( greenC )
- {
- d.disableStyle();
- d.setFill(0);
- }
- }
Add Comment
Please, Sign In to add comment