Tuesday, March 05, 2013

Unity Engine: Text

Tried using GUI Text and 3D Text. GameObject > Create Other > ...
preferred 3D Text. easier placement using (x, y, z). easier to preview in Scene view.
GUI Text uses the [0,1] for location. (0,0) for bottom left, (1,1) for top right?

To change font, copy the desired TTF font in the Assets view. select the text GameObject and change the Font in Inspector.



to access the text from the GameObject:
  1. use GameObject.Find()
  2. use GetComponent()
  3. use .text property

No comments: