Advertisement
caitlinorbanek

Untitled

Dec 13th, 2011
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. int key_pressed;
  2.  
  3. PFont f;
  4.  
  5.  
  6. String yourtext = "";
  7.  
  8.  
  9. String saved = "";
  10.  
  11. void setup() {
  12. size(800, 800);
  13. f = loadFont("GentiumBookBasic-BoldItalic-20.vlw");
  14.  
  15.  
  16.  
  17. }
  18.  
  19. void draw() {
  20. background(0, 36, 255);
  21. int indent = 400;
  22. textFont(f);
  23. fill(0);
  24.  
  25. // Display everything
  26. text("Now to really blow your mind- \nCheck out this numeral replacement. ", indent, 40);
  27. text(yourtext,indent-300,150);
  28. text(yourtext,indent-300,1200);
  29.  
  30.  
  31.  
  32. }
  33.  
  34.  
  35.  
  36. void keyPressed() {
  37.  
  38. if ((key >= 65 && key < 90) | (key >= 97 && key < 122)){
  39. key_pressed = (key + 1);
  40. }
  41. else if (key == 91 | key == 122) {
  42. key_pressed = 65;
  43. }
  44.  
  45.  
  46. if (key == '\n' ) {
  47. saved = yourtext;
  48. yourtext = "";
  49. } else {
  50. yourtext = yourtext + key_pressed;
  51. }
  52. }
  53.  
  54.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement