Fonts are an important part of the UI. Create a font with ngui 3.5 today.
The following is a demo of my shooting game. The ngui font is used to display the number of bullets. The effect is as follows:
Steps:
1,Search for (or make) fonts. The figure here is convenient. I directly use the font of the demo project in unity: xirod. TTF.
Under win7, double-click to preview. Display the font size.
2,Open the project, create a font directory under the assets directory, and copy the font file, that is, the TTF file.
3,Create an empty game body: gameobject --> Crete empty. To facilitate management, name the game weight font_xirod.
4,In the Inspector panel, add the ngui font script component to the empty game body. (Search for font)
5,Set the font component:
Set Font type to dynamic
TTF font is set to xirod
6,Drag font_xirod in hierarchy to the project to make the prefab (prefab) and then delete the game body.
7,If the UI root already exists, create a new label (ngui --> Create --> label) in the scenario ). If there is no UI root, you can create one.
8,Select the new label. In the Inspector panel, select font and select the new font.
9,Set the font size, and click "Snap.
10,Adjust the position. OK, the font is displayed normally!
Note:: Ngui prompt, dynamic font, cannot be made part of Atlas, use dynamic font will add draw call at least once.
Zookeeper
Ngui 3.5 tutorial (6) font