MCPcopy Create free account
hub / github.com/Aloshi/EmulationStation / render

Method render

src/components/TextComponent.cpp:59–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59void TextComponent::render(const Eigen::Affine3f& parentTrans)
60{
61 std::shared_ptr<Font> font = getFont();
62
63 Eigen::Affine3f trans = parentTrans * getTransform();
64
65 if(font && !mText.empty())
66 {
67 Renderer::setMatrix(trans);
68
69 if(mCentered)
70 {
71 Eigen::Vector2f textSize = font->sizeWrappedText(mText, getSize().x());
72 Eigen::Vector2f pos((getSize().x() - textSize.x()) / 2, 0);
73 font->drawWrappedText(mText, pos, getSize().x(), (mColor >> 8 << 8) | getOpacity());
74 }else{
75 font->drawWrappedText(mText, Eigen::Vector2f(0, 0), getSize().x(), mColor >> 8 << 8 | getOpacity());
76 }
77 }
78
79 GuiComponent::renderChildren(trans);
80}
81
82void TextComponent::calculateExtent()
83{

Callers

nothing calls this directly

Calls 4

setMatrixFunction · 0.85
sizeWrappedTextMethod · 0.80
drawWrappedTextMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected