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

Method onDraw

tests/cpp-tests/Source/Texture2dTest/Texture2dTest.cpp:2021–2034  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2019}
2020
2021void TextureDrawAtPoint::onDraw(const Mat4& transform, uint32_t flags)
2022{
2023 Director* director = Director::getInstance();
2024 AXASSERT(nullptr != director, "Director is null when setting matrix stack");
2025 director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
2026 director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, transform);
2027
2028 auto s = Director::getInstance()->getWinSize();
2029
2030 _tex1->drawAtPoint(Vec2(s.width / 2 - 50, s.height / 2 - 50), _globalZOrder);
2031 _Tex2F->drawAtPoint(Vec2(s.width / 2 + 50, s.height / 2 - 50), _globalZOrder);
2032
2033 director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
2034}
2035
2036// TextureDrawInRect
2037

Callers

nothing calls this directly

Calls 9

getInstanceFunction · 0.85
pushMatrixMethod · 0.80
loadMatrixMethod · 0.80
drawAtPointMethod · 0.80
popMatrixMethod · 0.80
drawInRectMethod · 0.80
Vec2Function · 0.50
RectClass · 0.50
getContentSizeMethod · 0.45

Tested by

no test coverage detected