- Pfont font:宣告字型資料型態
- font = loadFont(“Eureka-48.vlw”):讀取字型檔
- textFont(font,int):設定文字字型,大小
- text(String,x,y):以(x,y)座標為起點,打上String字
- fill(0,opacity):調整透明度
- textSize(number):設定字型大小
- textWidth(String) 、 textWidth(Char) : 取得文字框框寬度
Rotate word
- pushMatrix()~popMatrix():保存座標系
- translate(x,y):將中心點轉到(x,y),到時將以(x,y)為中心旋轉
- rotate(angle):整個畫面旋轉angle度
- textAlign(CENTER):將文字框框的起點設在中心位置
String and Char
- String.charAt(i):取得字串的第i個位置的字元
- char[] letters , letters = String.toCharArray() : 將String拆成一個個的字元存進字元陣列裡
- float[] y , y = new float[size] :動態設定浮點數陣列與其長度
Exercises
- Select a noun and an adjective. Animate the noun to reveal the adjective.
- Use a transformation functions to animate a short phrase.
- Select a verb and animate each letter of the word to convey its meaning.
Reference
- Casey Reas & Ben Fry : Page354
沒有留言:
張貼留言