Lena-F

By wangl
/* As a fashion lover, i decided to add a twist of brands in my project. The background contains all the letters of the alphabet book. However, when you press the corresponding key, a brand name logo will show up in the place of the letter. If you press all the alphabet, then the screen will be a puzzle of brand logos! */ PFont font; void setup () { size (400, 400); font = loadFont ("ArialMT-100.vlw"); //load font Ariel textFont (font); fill (0); background (162); text ("A", 120, 190); //placing the letters randomly text ("B", 260, 320); text ("C", 23, 88); text ("D", 350, 150); text ("E", 0, 400); } void draw () {} void keyPressed() { if(key=='a') //if "a" is pressed, then { PImage a;//it will load the image A.jpg a = loadImage("A.jpg"); image(a, 50, 100); // at this location. } if(key == 'b')//so on and forth { PImage b; b = loadImage ("B.jpg"); image (b, 240, 240); } if (key == 'c') { PImage c; c = loadImage ("C.jpg"); image (c, 15, 15); } if (key == 'd') { PImage d; d = loadImage ("D.gif"); image (d, 320, 70); } if (key == 'e') { PImage e; e = loadImage ("E.gif"); image (e, 0, 330); } }

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*