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

Method initWithSpriteFrame

core/2d/Sprite.cpp:248–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246}
247
248bool Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame)
249{
250 AXASSERT(spriteFrame != nullptr, "spriteFrame can't be nullptr!");
251 if (spriteFrame == nullptr)
252 return false;
253
254 bool ret = initWithTexture(spriteFrame->getTexture(), spriteFrame->getRect(), spriteFrame->isRotated());
255 setSpriteFrame(spriteFrame);
256
257 return ret;
258}
259
260bool Sprite::initWithPolygon(const ax::PolygonInfo& info)
261{

Callers 7

createWithSpriteFrameMethod · 0.45
createWithSpriteFrameMethod · 0.45
loadFromPackageMethod · 0.45
createWithSpriteFrameMethod · 0.45
createWithSpriteFrameMethod · 0.45
createWithSpriteFrameMethod · 0.45

Calls 3

setSpriteFrameFunction · 0.85
getRectMethod · 0.80
getTextureMethod · 0.45

Tested by

no test coverage detected