Guest User

Untitled

a guest
Apr 26th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. void setup
  2. {
  3. d = createShape(); // d is a PShape
  4. d.beginShape();
  5. fill(100);
  6. rect(200,200,200,200);
  7.  
  8. d.endShape(CLOSE);
  9. d.disableStyle()
  10. }
  11.  
  12. void draw()
  13. {
  14. shape(d, 300, 250);
  15. if ( mouseX >= 0 && mouseX <= 600 && mouseY >=0 && mouseY <= 600 )
  16. {
  17. greenC = true; //a boolean
  18. }
  19. }
  20.  
  21. public void mousePressed()
  22. {
  23. if ( greenC )
  24. {
  25.  
  26. d.disableStyle();
  27. d.setFill(0);
  28.  
  29. }
  30. }
Add Comment
Please, Sign In to add comment