Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void write_word(String[] words) {
- int n = int(random(words.length));
- textSize(random(20,40)); // the random is making the text size between 20 and 40 at random
- text(words[n], random(50, 150), y);
- y = y + 30; //text spacing
- }
- void new_sentence() {
- background(#FFC4C4);
- y = 50;
- write_word(art); //wriitng an array into a function
- write_word(adj);
- write_word(nou);
- write_word(ver);
- write_word(pre);
- write_word(art);
- write_word(adj);
- write_word(nou);
- }
- void setup() {
- size(500,400);
- background(#FFC4C4);
- fill(#FF1A1A);
- new_sentence();
- }
- void draw(){ //if there isnt a void draw the moust pressed funtion wont work
- }
- void mousePressed(){
- new_sentence();
- }
- //articles
- void keyPressed() {
- int random_number = int(random(1000000));
- save(random_number + ".png");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement