TextInlineSprite icon indicating copy to clipboard operation
TextInlineSprite copied to clipboard

UGUI图文混排 unity version: 2017.2+

Results 26 TextInlineSprite issues
Sort by recently updated
recently updated
newest added

添加Content Size Fitter组件,RectTransform大小不会跟着文字内容变化而变化

渲染一个表情在v3.0的实现里,流程大致如下: **【流程一】** InlineText.OnPopulateMesh转换表情顶点至全局坐标,InlineManager.UpdateTextInfo再将全局坐标转换到SpriteGraphic下的局部坐标。 **【流程二】** InlineManager.Update合批相同表情ID的Mesh,转输到SpriteGraphic.OnPopulateMesh作最终渲染。 因为InlineManager.Update合批Mesh,所以这两个流程相差1帧。如果InlineText的坐标在这帧变动了(如列表划动),因为没其它逻辑去强刷缓存在InlineManager的EmojiText.Taurus.MeshInfo坐标,所以SpriteGraphic.OnPopulateMesh使用的是不正确的坐标。结果显示上表情位置偏移了。 像ChatTest样例中,监听ScrollRect.onValueChanged事件,修复SpriteGraphic坐标并未解决以上问题。因为它是与 **【流程一】** 同帧进行。依然与 **【流程二】** 相差了1帧。 ```c# private void OnSrcollViewChanged(Vector2 pos) { _spriteRect.anchoredPosition = _scrollView.content.anchoredPosition; } ``` **测试代码如下:** ```c# public class Test : MonoBehaviour {...

支持汽包自适应吗?

分支1的SpriteGraphic是放在text下面的,分支2的全部放在同一个SpriteGraphic下面,这样我不能使用无限滚动列表来做聊天,不好控制了

我把导进来的图片设为default格式,然后创建Asset文件,但是我在Text里输入对应的格式,显示不出来

https://forum.unity.com/threads/ugui-unity5-6-canvasrenderer-vertex-define-has-no-uv1.494790/ 在Canvas的Additional Shader Channels中设置 Set in Canvas - Additional Shader Channels - TexCoord1 - TexCoord3. Also support Normal

Assets/EmojiText/Scripts/InlineText.cs(399,20): error CS0019: Operator `*' cannot be applied to operands of type `UnityEngine.Vector2' and `UnityEngine.Vector2'

设计好UI结构如下图: # ![1](https://user-images.githubusercontent.com/19681139/38792499-d48a1ee6-417f-11e8-90e8-1987d574f181.png) 设置Text的Alignment为居中对齐。 如果不修改表情图片Asset的大小,使用作者的默认值24,是能够保证居中对齐的,但是我的表情原图是64*64,我想尽量保证显示原图大小的表情这时候就出现问题了: 如果只是输入文字或者只是输入表情图片,是正确居中对齐的。但是同时输入表情和文字后发现文字并没有居中对齐。 ![3](https://user-images.githubusercontent.com/19681139/38792787-4c09572e-4181-11e8-93e2-75885a5f6adf.png) ![4](https://user-images.githubusercontent.com/19681139/38792790-4e87f082-4181-11e8-8ef0-2b652f6aec72.png) ![2](https://user-images.githubusercontent.com/19681139/38792792-504f2ebc-4181-11e8-8489-e017cf9b652c.png) **Canvas的RenderMode为ScreeSpace-Camera,但是我发现这个问题好像跟Canvas的模式没多大关系!**