Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RichText, Label 修改透明,导致文本不可见 #18290

Open
hssing opened this issue Feb 7, 2025 · 1 comment
Open

RichText, Label 修改透明,导致文本不可见 #18290

hssing opened this issue Feb 7, 2025 · 1 comment
Labels
Bug Needs Triage Needs to be assigned by the team

Comments

@hssing
Copy link

hssing commented Feb 7, 2025

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

@hssing hssing added Bug Needs Triage Needs to be assigned by the team labels Feb 7, 2025
@hssing
Copy link
Author

hssing commented Feb 7, 2025

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Needs to be assigned by the team
Projects
None yet
Development

No branches or pull requests

1 participant