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

Method initWithSpriteFrameName

core/2d/Sprite.cpp:235–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235bool Sprite::initWithSpriteFrameName(std::string_view spriteFrameName)
236{
237 AXASSERT(!spriteFrameName.empty(), "Invalid spriteFrameName");
238 if (spriteFrameName.empty())
239 return false;
240
241 _fileName = spriteFrameName;
242 _fileType = 1;
243
244 SpriteFrame* frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName);
245 return initWithSpriteFrame(frame);
246}
247
248bool Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame)
249{

Callers

nothing calls this directly

Calls 3

getInstanceFunction · 0.85
getSpriteFrameByNameMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected