MCPcopy Create free account
hub / github.com/axmolengine/axmol / addSpriteFrameWithFile

Method addSpriteFrameWithFile

core/2d/Animation.cpp:170–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170void 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
179void Animation::addSpriteFrameWithTexture(Texture2D* pobTexture, const Rect& rect)
180{

Callers 2

onEnterMethod · 0.80

Calls 4

getInstanceFunction · 0.85
getTextureCacheMethod · 0.80
addImageMethod · 0.45
getContentSizeMethod · 0.45

Tested by 2

onEnterMethod · 0.64