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

Method createWithSpriteFrame

core/2d/Sprite.cpp:129–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129Sprite* Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame)
130{
131 Sprite* sprite = new Sprite();
132 if (spriteFrame && sprite->initWithSpriteFrame(spriteFrame))
133 {
134 sprite->autorelease();
135 return sprite;
136 }
137 AX_SAFE_DELETE(sprite);
138 return nullptr;
139}
140
141Sprite* Sprite::createWithSpriteFrameName(std::string_view spriteFrameName)
142{

Callers

nothing calls this directly

Calls 2

autoreleaseMethod · 0.80
initWithSpriteFrameMethod · 0.45

Tested by

no test coverage detected