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

Can't tween color of cc.Sprite #13229

Closed
BenoitFreslon opened this issue Nov 2, 2022 · 6 comments
Closed

Can't tween color of cc.Sprite #13229

BenoitFreslon opened this issue Nov 2, 2022 · 6 comments
Assignees
Labels
Milestone

Comments

@BenoitFreslon
Copy link

Cocos Creator version

3.6.1

System information

OSX

Issue description

Hello,

I want to tween the color of a cc.Sprite with this line:

`    tween(this.sprite1).to(3, { color:Color.TRANSPARENT }).start();`

But the color property is not present.
image

Regarding this post, this bug should be fixed in CocosCretor 3.6
https://discuss.cocos2d-x.org/t/fade-in-and-out/55902/2

But I got this problem with CocosCreator 3.6.1.

I need to add UIOpacity component to change the opacity property.

tween(this.sprite1.getComponent(UIOpacity)).to(1, { opacity:0 }).start();

Relevant error log output

No response

Steps to reproduce

Add a Sprite component then try to tween the color.
tween(this.sprite1).to(3, { color:Color.TRANSPARENT }).start();

Minimal reproduction project

No response

@BenoitFreslon BenoitFreslon added Bug Needs Triage Needs to be assigned by the team labels Nov 2, 2022
@minggo minggo removed the Needs Triage Needs to be assigned by the team label Nov 22, 2022
@holycanvas holycanvas assigned zxx43 and unassigned holycanvas Aug 4, 2023
@zxx43 zxx43 mentioned this issue Aug 24, 2023
6 tasks
@zxx43 zxx43 assigned minggo and unassigned zxx43 Oct 23, 2023
@minggo minggo assigned bofeng-song and unassigned minggo Oct 24, 2023
@minggo
Copy link
Contributor

minggo commented Oct 24, 2023

@bofeng-song please discuss with @qiuguohua , who will take charge of it.

1 similar comment
@minggo
Copy link
Contributor

minggo commented Oct 24, 2023

@bofeng-song please discuss with @qiuguohua , who will take charge of it.

@minggo minggo assigned qiuguohua and unassigned bofeng-song Oct 24, 2023
@dumganhar
Copy link
Contributor

dumganhar commented May 10, 2024

@BenoitFreslon Cocos Creator uses Entity Component architecture. So Node is an entity without any rendering relative functionality. So you can't tween color property on Node since it doesn't exist on Node.

@minggo minggo added the Rejected Issue rejected by development team, the issue won't be fixed label May 10, 2024
@minggo minggo closed this as completed May 10, 2024
@dumganhar dumganhar reopened this May 12, 2024
@dumganhar
Copy link
Contributor

I misunderstand the issue.
The issue is to create a tween color for sprite component, it is not relative to color property on Node. I will fix this issue soon.

@dumganhar dumganhar assigned dumganhar and unassigned qiuguohua May 12, 2024
@dumganhar dumganhar added this to the 3.8.5 milestone May 12, 2024
@BenoitFreslon
Copy link
Author

Yes it is.
If I remeber the old documentation shows an example with a tween to change the color sprite. That's why I posted this.
Thanks.

@dumganhar dumganhar removed the Rejected Issue rejected by development team, the issue won't be fixed label May 12, 2024
@dumganhar
Copy link
Contributor

dumganhar commented May 12, 2024

@BenoitFreslon , thanks for your report. I submitted a pull request here #16977
If you get time, you could apply this patch to verify whether it works for you.

@dumganhar dumganhar assigned minggo and unassigned dumganhar May 23, 2024
@dumganhar dumganhar mentioned this issue May 23, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

7 participants