| 1600 | } |
| 1601 | |
| 1602 | void Sprite::setDisplayFrameWithAnimationName(std::string_view animationName, unsigned int frameIndex) |
| 1603 | { |
| 1604 | AXASSERT(!animationName.empty(), "CCSprite#setDisplayFrameWithAnimationName. animationName must not be nullptr"); |
| 1605 | if (animationName.empty()) |
| 1606 | return; |
| 1607 | |
| 1608 | Animation* a = AnimationCache::getInstance()->getAnimation(animationName); |
| 1609 | |
| 1610 | AXASSERT(a, "CCSprite#setDisplayFrameWithAnimationName: Frame not found"); |
| 1611 | |
| 1612 | AnimationFrame* frame = a->getFrames().at(frameIndex); |
| 1613 | |
| 1614 | AXASSERT(frame, "CCSprite#setDisplayFrame. Invalid frame"); |
| 1615 | |
| 1616 | setSpriteFrame(frame->getSpriteFrame()); |
| 1617 | } |
| 1618 | |
| 1619 | bool Sprite::isFrameDisplayed(SpriteFrame* frame) const |
| 1620 | { |
nothing calls this directly
no test coverage detected