shiffman / LearningProcessing

A repo for examples from the book Learning Processing
http://learningprocessing.com
606 stars 276 forks source link

Learning Processing Exercise 17-85 Errata Corrige #199

Closed SetupandDraw closed 8 years ago

SetupandDraw commented 8 years ago

The code inside exercise_17_08_text_in_3D.pde is a bit messy, I think it should be:

// http://www.learningprocessing.com

// Exercise 17-8: Display text that is centered and rotated to appear flat. Have the text scroll off into the distance.

//“\n” means “new line.” In Java, invisible characters can be incorporated into a String with an “escape sequence”-a backward slash “\” followed by a character. // Here are a few more. // \n-new line // \r-carriage return // \t-tab // \'-single quote // \”-double quote // -backward slash

String info = "A long long time ago\nIn a galaxy far far away"; PFont f; float y = 0;

void setup() { size(400, 200, P3D); f = createFont( "Arial", 12); } void draw() { background(255); fill(0); translate(width/2, height/2); rotateX(PI/4); textFont(f); textAlign(CENTER); text(info, 0, y); y--; }

shiffman commented 8 years ago

Thanks for pointing this out!