| 168 | } |
| 169 | |
| 170 | void Animation::addSpriteFrameWithFile(std::string_view filename) |
| 171 | { |
| 172 | Texture2D* texture = Director::getInstance()->getTextureCache()->addImage(filename); |
| 173 | Rect rect = Rect::ZERO; |
| 174 | rect.size = texture->getContentSize(); |
| 175 | SpriteFrame* frame = SpriteFrame::createWithTexture(texture, rect); |
| 176 | addSpriteFrame(frame); |
| 177 | } |
| 178 | |
| 179 | void Animation::addSpriteFrameWithTexture(Texture2D* pobTexture, const Rect& rect) |
| 180 | { |