29. Text I

12
From last time… Explored filters, blend modes, and masks Wrapped up PImage, Capture, and Movie

Transcript of 29. Text I

Page 1: 29. Text I

From last time…

• Explored filters, blend modes, and masks!

• Wrapped up PImage, Capture, and Movie

Page 2: 29. Text I

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?

Page 3: 29. Text I

www.freemusicarchive.org

Page 4: 29. Text I

CAP 3032

Text I

Page 5: 29. Text I

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);

Page 6: 29. Text I

Basic String MethodscharAt(index)

equals(“hey”)

indexOf(“M”)

length()

substring(beginInd) OR substring(beginInd, endInd)

toLowerCase()

toUpperCase()

Page 7: 29. Text I

String Manipulationjoin(list[], separator)

split(str, delimiterString)

splitTokens(str, delimitersString)

trim(str) // removes white space from ends

nf(num, digits)

nfc() nfp() nfs() // comma, positive, space

Page 8: 29. Text I

Display & Loadingtext(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…

Page 9: 29. Text I

Setting Attributes

textFont() // sets the typeface

textSize() // sets the size

textAlign() // sets the alignment

textLeading() // sets the line spacing

Page 10: 29. Text I

Getting Attributes

textWidth(str) // returns width of line

.textAscent() // returns ascender height

.textDescent() // returns descender height

Page 11: 29. Text I

Text as Image

Page 12: 29. Text I

For next time…

• Reading: Shiffman, pp. 314–324 (Text II)!

• Homework 5: posted online (Text as Image)!

• Iteration 3: presentations about 1 week away