cocos-engine
cocos-engine copied to clipboard
RichText, Label 修改透明,导致文本不可见
Cocos Creator version
3.8.4
System information
原生平台(模拟器, 安卓)
Issue description
1.RichText问题描述: 有两个界面A,B,首先打开A界面,在A界面中,有N多个富文本,再一定时间间隔内随机文本进行渐变显示隐藏,之后打开 B 界面,在B界面中有用richtext显示文本,这时候,有很大概率 B中富文本内容显示不全。经反复测试,发现是 richtext中使用了 lablepool,在当 放入 池中的 label的透明度被设置为0后,再次被其他richtext再次利用时,没有重置 这个透明度,导致不显示,在richtext中添加 _applyTextAttribute 方法label.updateRenderData(true);前添加如下代码可解决,期待官方修复。 label.renderEntity.localOpacity = 1; label.renderEntity.colorDirty = true;
2.lale的问题也类似。问题描述: 首先创建了一个 label添加到节点树中,在下一帧中,创建一个新节点,并给这个节点加上 Mask组件, 将这个label添加到带有 Mask的节点中,这时候,改变新建节点的父节点的 透明度做动画,导致label文本一直不显示。 同样设置 如下代码后可解决,期待官方修复 label.renderEntity.localOpacity = 1; label.renderEntity.colorDirty = true;
Relevant error log output
No response
Steps to reproduce
如上
Minimal reproduction project
No response