Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1.  
  2. void write_word(String[] words) {
  3.  
  4. int n = int(random(words.length));
  5.  
  6.  
  7. textSize(random(20,40)); // the random is making the text size between 20 and 40 at random
  8. text(words[n], random(50, 150), y);
  9.  
  10.  
  11. y = y + 30; //text spacing
  12.  
  13. }
  14.  
  15.  
  16. void new_sentence() {
  17. background(#FFC4C4);
  18.  
  19. y = 50;
  20. write_word(art); //wriitng an array into a function
  21. write_word(adj);
  22. write_word(nou);
  23.  
  24. write_word(ver);
  25. write_word(pre);
  26.  
  27. write_word(art);
  28. write_word(adj);
  29. write_word(nou);
  30. }
  31.  
  32. void setup() {
  33. size(500,400);
  34. background(#FFC4C4);
  35. fill(#FF1A1A);
  36. new_sentence();
  37.  
  38. }
  39.  
  40. void draw(){ //if there isnt a void draw the moust pressed funtion wont work
  41. }
  42.  
  43. void mousePressed(){
  44. new_sentence();
  45. }
  46. //articles
  47. void keyPressed() {
  48. int random_number = int(random(1000000));
  49. save(random_number + ".png");
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement