Improve progress timer (#375)

This commit is contained in:
halx99 2021-06-13 10:05:30 +08:00 committed by GitHub
parent 9705ef7f11
commit 382a12f181
2 changed files with 12 additions and 1 deletions

View File

@ -3,6 +3,7 @@ Copyright (c) 2010 Lam Pham
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2013-2017 Chukong Technologies Inc
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
Copyright (c) 2021 Bytedance Inc.
http://www.cocos2d-x.org
@ -229,6 +230,14 @@ Vec2 ProgressTimer::vertexFromAlphaPoint(Vec2 alpha)
return ret;
}
void ProgressTimer::updateDisplayedOpacity(uint8_t parentOpacity)
{
Node::updateDisplayedOpacity(parentOpacity);
_sprite->updateDisplayedOpacity(_displayedOpacity);
updateProgress();
}
void ProgressTimer::updateColor()
{
if (!_sprite)

View File

@ -3,6 +3,7 @@ Copyright (c) 2010 Lam Pham
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2013-2016 Chukong Technologies Inc.
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
Copyright (c) 2021 Bytedance Inc.
http://www.cocos2d-x.org
@ -176,7 +177,8 @@ protected:
void updateProgress();
void updateBar();
void updateRadial();
virtual void updateColor() override;
void updateDisplayedOpacity(uint8_t parentOpacity) override;
void updateColor() override;
Vec2 boundaryTexCoord(char index);
Type _type = Type::RADIAL;