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

Method init

tests/cpp-tests/Source/Texture2dTest/Texture2dTest.cpp:196–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196bool TextureETC1Alpha::init()
197{
198 if (!TextureDemo::init())
199 return false;
200
201 auto& canvasSize = getContentSize();
202 _background = LayerColor::create(Color4B(15, 19, 42, 255), canvasSize.width, canvasSize.height);
203 _background->setIgnoreAnchorPointForPosition(false);
204 _background->setAnchorPoint(Vec2::ANCHOR_MIDDLE);
205
206 auto s = Director::getInstance()->getWinSize();
207 _background->setPosition(Vec2(s.width / 2, s.height / 2));
208 this->addChild(_background);
209
210 addNewSpriteWithCoords(Vec2(s.width / 2, s.height / 2));
211 return true;
212}
213
214void TextureETC1Alpha::addNewSpriteWithCoords(Vec2 p)
215{

Callers

nothing calls this directly

Calls 9

createFunction · 0.85
Color4BFunction · 0.85
getInstanceFunction · 0.85
initFunction · 0.50
Vec2Function · 0.50
setAnchorPointMethod · 0.45
setPositionMethod · 0.45
addChildMethod · 0.45

Tested by

no test coverage detected