mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
Merge pull request #225 from minggo/sync-15723
blend mode does not work with animated sprite
This commit is contained in:
@@ -2338,7 +2338,9 @@ void Animate::stop()
|
||||
{
|
||||
if (_animation->getRestoreOriginalFrame() && _target)
|
||||
{
|
||||
auto blend = static_cast<Sprite*>(_target)->getBlendFunc();
|
||||
static_cast<Sprite*>(_target)->setSpriteFrame(_origFrame);
|
||||
static_cast<Sprite*>(_target)->setBlendFunc(blend);
|
||||
}
|
||||
|
||||
ActionInterval::stop();
|
||||
@@ -2373,12 +2375,16 @@ void Animate::update(float t)
|
||||
|
||||
if( splitTime <= t )
|
||||
{
|
||||
auto blend = static_cast<Sprite*>(_target)->getBlendFunc();
|
||||
_currFrameIndex = i;
|
||||
AnimationFrame* frame = frames.at(_currFrameIndex);
|
||||
frameToDisplay = frame->getSpriteFrame();
|
||||
CCASSERT(_target, "Animate::update error: _target should not null");
|
||||
if(_target)
|
||||
{
|
||||
static_cast<Sprite*>(_target)->setSpriteFrame(frameToDisplay);
|
||||
static_cast<Sprite*>(_target)->setBlendFunc(blend);
|
||||
}
|
||||
|
||||
const ValueMap& dict = frame->getUserInfo();
|
||||
if ( !dict.empty() )
|
||||
|
||||
Reference in New Issue
Block a user