1、下载BMFont官网
2、首先你还得有美术制作的艺术字,或者自己做几个艺术字。好吧,全部奉上
3、使用BMFont制作艺术字图集
4、将生成的.fnt文件和图集.png文件导入到项目中
5、你还得有NGUI的有关BMFont的代码,不知道在哪?已经全部奉上啦
6、制作CustomFont,按照教程来做挺累的,编辑器上场
using UnityEngine
using UnityEditor
public class BMFontEditor : EditorWindow
{
[MenuItem("Tools/BMFont Maker")]
static public void OpenBMFontMaker()
{
EditorWindow.GetWindow<BMFontEditor>(false, "BMFont Maker", true).Show()
}
[SerializeField]
private Font targetFont
[SerializeField]
private TextAsset fntData
[SerializeField]
private Material fontMaterial
[SerializeField]
private Texture2D fontTexture
最近需求做一个界面上Text,想到当时用Cocos-2dx开发时,曾经用过的fnt、plist这一套东西,就想找一下在UGUI里面的Text如何使用自定义的字体。最先找到的参考内容见王熊猫demon的博客 uGUI文本控件测试
private void button1_Click(object sender, EventArgs e){Font newFont newFont = new Font(this.richTextBox1.SelectionFont, this.richTextBox1.SelectionFont.Style | FontStyle.Bold | FontStyle.Underline | FontStyle.Italic ) this.richTextBox1.SelectionFont = newFont }欢迎分享,转载请注明来源:内存溢出
评论列表(0条)