29. Text I

186 views

Published on

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
186
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

29. Text I

  1. 1. From last time… • Explored filters, blend modes, and masks! • Wrapped up PImage, Capture, and Movie
  2. 2. Iteration 3 & Final • Your final project is 15% of your grade! • Judged independently of your iterations on the following aspects:! 1. Visceral: how does it look and feel? Polished, professional, pleasant?! 2. Functional: is the code clean? Are there bugs, or does it run smoothly?! 3. Reflective: is it fun? Does it give me information? Is it interesting and does it make me think?
  3. 3. www.freemusicarchive.org
  4. 4. CAP Text I
  5. 5. Char’s & String’s • A char is a primitive type for a ‘character’ of text! char myChar = ‘a’; // only single characters • A String can be thought of as an array of char objects! String myStr = “hi!”; // a string of text println(myChar); println(myStr);
  6. 6. Basic String Methods charAt(index) equals(“hey”) indexOf(“M”) length() substring(beginInd) OR substring(beginInd, endInd) toLowerCase() toUpperCase()
  7. 7. String Manipulation join(list[], separator) split(str, delimiterString) splitTokens(str, delimitersString) trim(str) // removes white space from ends nf(num, digits) nfc() nfp() nfs() // comma, positive, space
  8. 8. Display & Loading text(text,x,y) // draws given text to x, y PFont .vlw // font file extension loadFont() // loads existing .vlw createFont() // create a .vlw on the fly Create a vlw: Tools Menu, Create Font…
  9. 9. Setting Attributes textFont() // sets the typeface textSize() // sets the size textAlign() // sets the alignment textLeading() // sets the line spacing
  10. 10. Getting Attributes textWidth(str) // returns width of line .textAscent() // returns ascender height .textDescent() // returns descender height
  11. 11. Text as Image
  12. 12. For next time… • Reading: Shiffman, pp. 314–324 (Text II)! • Homework 5: posted online (Text as Image)! • Iteration 3: presentations about 1 week away

×