MCPcopy Create free account
hub / github.com/AbyssEngine/AbyssEngineOld / drawCentered

Method drawCentered

src/Abyss/UI/Label.cpp:67–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67void Label::drawCentered(const int x, const int y) const {
68 if (!_texture || _text.empty())
69 return;
70
71 const auto renderer = Singletons::getRendererProvider().getRenderer();
72 const SDL_Rect rect{x - _width / 2, y - _height / 2, _width, _height};
73 SDL_RenderCopy(renderer, _texture.get(), nullptr, &rect);
74}
75
76} // namespace Abyss::UI

Callers 1

renderMainMenuMethod · 0.80

Calls 2

emptyMethod · 0.80
getRendererMethod · 0.80

Tested by

no test coverage detected