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

Fix for Non-TTF Label Shadow, it makes it follow label opacity #18324

Merged
merged 1 commit into from Oct 23, 2017

Conversation

SBJoker
Copy link
Contributor

@SBJoker SBJoker commented Sep 26, 2017

Bug: If FadeTo action applied to Label with non-TTF font with shadow, shadow stay opaque and doesn't fade as label.

@@ -1505,7 +1505,7 @@ void Label::onDrawShadow(GLProgram* glProgram, const Color4F& shadowColor)
{
Color3B oldColor = _realColor;
GLubyte oldOPacity = _displayedOpacity;
_displayedOpacity = shadowColor.a * 255;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do it like this? shadowColor.a is already a float

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand a question. shadowColor.a is a float, definitely.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about it. I misunderstood it. Could you please provide a test case to reproduce it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just create a Label using Label::createWithBMFont, enable shadow for it. Run action FadeOut for it.
You can see label fadeout, but shadow doesn't fade.

@minggo minggo added this to the 3.17 milestone Oct 23, 2017
@minggo minggo merged commit f0be714 into cocos2d:v3 Oct 23, 2017
stevetranby added a commit to stevetranby/cocos2d-x that referenced this pull request Oct 24, 2017
* commit '76ba85adfbb1deedf52162386012afa961c9c016':
  Make cocos' Android.mk self containing (cocos2d#18392) (cocos2d#18393)
  [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (cocos2d#18397)
  Fix for Non-TTF Label Shadow, it makes it follow label opacity (cocos2d#18324)
  Remove autorelease mark from UIWebViewWrapper and manage memory manually (cocos2d#18391)
  Corrected bugs with cursor in TextField (cocos2d#18371)
  Fix Windows 10 compilation (cocos2d#18394)

# Conflicts:
#	cocos/base/ccConfig.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants