Week 7 - Tut­o­r­i­a­l 12/14

by Matthew Brunker
  • Show Sketch
/** @peep sketchcode */
 
//Testing writing text within processing
 
size(200, 200);
background(204);
fill(0);
text("Tutorial One", 60, 40);
text("Week 7", 60, 100);
text("Design Programming", 60, 160);
 
 
String s = "Testing area";
text(s, 130, 90, 90, 60);
  • Show Sketch
/** @peep sketchcode */
//Testing colours and dropshadow in text
 
size(300, 300);
background(204);
String s = "Christmas"; 
textSize(40);
fill(0, 64);
text(s, 11, 21, 160, 100);
fill(0, 128, 0);
text(s, 10, 20, 160, 100);
fill(128, 0, 0);
text(s, 9, 18, 160, 100);
fill(155);
text(s, 8, 17, 160, 100);
fill(255);
text(s, 7, 16, 160, 100);
  • Show Sketch
/* @pjs font=/uploads/user/16048/files/alexbrush-regular.ttf; */
/** @peep sketchcode */
size(200, 200);
background(204);
PFont font = createFont("/uploads/1/alexbrush-regular.ttf", 32);
textFont(font);
size(200, 200);
background(204);
fill(0); 
String s = "Oxford"; 
text(s, 10, 20, 80, 50);
  • Show Sketch
//Testing Font as well as changing the speed and animating text
 
/* @pjs font=/uploads/16048/alexbrush-regular.ttf; */
/** @peep sketchcode */
 
String scrollingText = "Oxfords not Brogues";
 
float x;
float dx = -2;
 
void setup() {
  size(200, 200);
  PFont font = createFont("/uploads/16048/alexbrush-regular.ttf", 72);
  textFont(font);
  x = width;
}
 
void draw() {
  background(204);
  fill(0);
  textAlign(LEFT, CENTER);
  text(scrollingText, x, height/4 + 20);
  x += dx;
  if (x <= -textWidth(scrollingText)) x = 200;
}

Comments

Nobody has said anything yet.