上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 48 下一页
摘要: #if UNITY_EDITOR using System; using System.IO; using UnityEditor; using UnityEngine; public static class SpriteTool { // OpenDirAfterExport const str 阅读全文
posted @ 2023-07-01 01:26 yanghui01 阅读(100) 评论(0) 推荐(0)
摘要: 最终效果,左侧为ugui的,右侧为自己实现的 using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class MyText : Graphic { public Font m_Font; 阅读全文
posted @ 2023-06-30 01:46 yanghui01 阅读(51) 评论(0) 推荐(0)
摘要: 效果,左侧为ugui的,右侧为自己实现的 using UnityEngine; using UnityEngine.UI; public class MyText : Graphic { public Font m_Font; public string m_Text = ""; public in 阅读全文
posted @ 2023-06-30 01:08 yanghui01 阅读(83) 评论(0) 推荐(0)
摘要: 最终效果 就简简单单一个利用Font把文本渲染出来 using UnityEngine; using UnityEngine.UI; public class MyText : Graphic { public Font m_Font; public string m_Text = "Hellow 阅读全文
posted @ 2023-06-29 01:46 yanghui01 阅读(67) 评论(0) 推荐(0)
摘要: Dynamic字符 1) ttf字体默认是Dynamic的,就是用到什么字符,运行时渲染对应的字符到字体贴图上 比如:Text组件上的New Text,在运行起来后字体贴图就渲染了NewText上去 2) 使用Font.GetCharacterInfo来获取字符信息 //不传fontSize参数, 阅读全文
posted @ 2023-06-29 01:36 yanghui01 阅读(436) 评论(0) 推荐(0)
摘要: string str = "abc key=\"hello\" key2=test key3= key4=\"\""; string pattern = @"(\S+)=""?([\w-.]+)""?"; //键值对正则表达式 MatchCollection result = Regex.Match 阅读全文
posted @ 2023-06-29 01:01 yanghui01 阅读(387) 评论(0) 推荐(0)
摘要: 最终效果 1) fnt文件上右击,执行命令 2) 空白位置右击,打开工具窗口生成fontsettings文件。 或者从菜单 -> Assets -> BMFont -> open BMFontTool打开 字体渲染中的几个术语 1) baseline, ascent, descent, Charac 阅读全文
posted @ 2023-06-29 00:51 yanghui01 阅读(1227) 评论(0) 推荐(0)
摘要: Font Settings 这边就是outline建议设为0(也就是关掉),这个在Unity中支持不是很好,而且BMFont生成的描边效果也很差。 Export Options padding和spacing建议不要使用0,可以减少边缘的毛糙效果。(下面第1张设置用的0,第2张用的2) 阅读全文
posted @ 2023-06-29 00:05 yanghui01 阅读(174) 评论(0) 推荐(0)
摘要: 用于解析BMFont软件生成的fnt文件 using System; using System.Collections.Generic; using System.Text.RegularExpressions; using UnityEngine; public class FntParse { 阅读全文
posted @ 2023-06-28 23:30 yanghui01 阅读(216) 评论(0) 推荐(0)
摘要: BMFont下载地址:BMFont - AngelCode.com Font Settings上的参数与fnt文件中的对应关系 Export Options上的参数与fnt文件中的对应关系 fnt文件中各字段的意义 face对应字体 size字体大小, 一般就是默认行高 bold粗体 italic斜 阅读全文
posted @ 2023-06-28 02:27 yanghui01 阅读(1153) 评论(0) 推荐(0)
上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 48 下一页