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

Method SpriteNilTexture

tests/cpp-tests/Source/SpriteTest/SpriteTest.cpp:3581–3602  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3579//------------------------------------------------------------------
3580
3581SpriteNilTexture::SpriteNilTexture()
3582{
3583 auto s = Director::getInstance()->getWinSize();
3584
3585 Sprite* sprite = nullptr;
3586
3587 // TEST: If no texture is given, then Opacity + Color should work.
3588
3589 sprite = Sprite::create();
3590 sprite->setTextureRect(Rect(0, 0, 300, 300));
3591 sprite->setColor(Color3B::RED);
3592 sprite->setOpacity(128);
3593 sprite->setPosition(Vec2(3 * s.width / 4, s.height / 2));
3594 addChild(sprite, 100);
3595
3596 sprite = Sprite::create();
3597 sprite->setTextureRect(Rect(0.0f, 0.0f, 300.0f, 300.0f));
3598 sprite->setColor(Color3B::BLUE);
3599 sprite->setOpacity(128);
3600 sprite->setPosition(Vec2(1 * s.width / 4, s.height / 2));
3601 addChild(sprite, 100);
3602}
3603
3604std::string SpriteNilTexture::title() const
3605{

Callers

nothing calls this directly

Calls 8

getInstanceFunction · 0.85
createFunction · 0.85
RectClass · 0.50
Vec2Function · 0.50
setTextureRectMethod · 0.45
setColorMethod · 0.45
setOpacityMethod · 0.45
setPositionMethod · 0.45

Tested by

no test coverage detected