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

Method reorderSprite

tests/cpp-tests/Source/SpriteTest/SpriteTest.cpp:614–628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

612}
613
614void SpriteZOrder::reorderSprite(float dt)
615{
616 auto sprite = static_cast<Sprite*>(getChildByTag(kTagSprite1));
617
618 int z = sprite->getLocalZOrder();
619
620 if (z < -1)
621 _dir = 1;
622 if (z > 10)
623 _dir = -1;
624
625 z += _dir * 3;
626
627 reorderChild(sprite, z);
628}
629
630std::string SpriteZOrder::title() const
631{

Callers

nothing calls this directly

Calls 7

getChildByTagFunction · 0.85
getTagMethod · 0.80
getChildByTagMethod · 0.45
reorderChildMethod · 0.45
atMethod · 0.45
sortAllChildrenMethod · 0.45
getParentMethod · 0.45

Tested by

no test coverage detected