zouchunyi / emojitext Goto Github PK
View Code? Open in Web Editor NEWBased on UGUI to support emoji system on Text component.
Based on UGUI to support emoji system on Text component.
输入文本:hello [2]
发生位移
可以做如下修改修复该问题:
`int dot = 0;//repair next line distance
for (int j = info.len - 1; j > 0; j--) {
if (verts [i + j * 4 + 3].position.y >= verts [i + 3].position.y) {
repairDistance += verts [i + j * 4 + 1].position.x - m_TempVerts [2].position.x;
break;
} else {
dot = i + 4 * j;
}
}`
比对的顶点应该是对应的顶点
老代码是
if (verts [i + j * 4].position.y >= verts [i + 3].position.y)
修改后是
if (verts [i + j * 4 + 3].position.y >= verts [i + 3].position.y)
建议在md中添加Canvas设置说明
换行的时候有BUG,现在是根据偏移量做减法,我觉得在正则表达式匹配完成后可以直接将对应的占位符用一个特殊字符替换掉。之后再调用
var settings = GetGenerationSettings(extents);
cachedTextGenerator.Populate(emojitext, settings);
计算出坐标,最后在设置需要显示表情位置顶点的UV即可,可省略计算偏移
测试场景里面的kiss表情([1])表现为从第二个kiss图切换到smile图(简言之就是这个表情本来应该用5图-10图结果用了6图-11图),但是[0]没事,后面的smile表情也没事,我的Unity版本是2017.2
你好,对比了很多方案,目前为止你的方案比较适合我们项目。比较遗憾的是大佬还没实现超链接
请问这个支持下划线和超链接吗?后续是否会有这方面的考虑?
希望作者能告诉为什么会产生这个错误。
这个使用这种的富文本不行啊,表情不显示了 显示%%。。。。谁会搞麻烦搞下吧
若存在 < b > < / b > 这类字符,则无法显示出颜文字,只会显示%%
string t = System.Convert.ToString (zhen - 1, 2); //sourceDic [key] 帧数
float r = 0, g = 0, b = 0;
if (t.Length >= 3) {
r = t [2] == '1' ? 0.5f : 0;
g = t [1] == '1' ? 0.5f : 0;
b = t [0] == '1' ? 0.5f : 0;
} else if (t.Length >= 2) {
r = t [1] == '1' ? 0.5f : 0;
g = t [0] == '1' ? 0.5f : 0;
} else {
r = t [0] == '1' ? 0.5f : 0;
}
Shader中是这样取出来的
half frameCount = 1 + sign(data.r) + sign(data.g) * 2 + sign(data.b) * 4; //二进制转换十进制
我尝试以下修改
//EmojiBuild
float zhenf = zhen / 10f;
dataTex.SetPixel(x / EmojiSize, y / EmojiSize, new Color(zhenf, zhenf, zhenf, 1));
//Shader
half frameCount = data.r * 10 - 1;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.