MCPcopy Create free account
hub / github.com/Illation/ETEngine / DrawText

Method DrawText

Engine/source/EtRendering/SceneRendering/TextRenderer.cpp:138–150  ·  view source on GitHub ↗

--------------------------------- TextRenderer::DrawText Creates a text cache and adds it to the active font

Source from the content-addressed store, hash-verified

136// Creates a text cache and adds it to the active font
137//
138void TextRenderer::DrawText(std::string const& text, vec2 const pos, int16 fontSize)
139{
140 ET_ASSERT(m_QueuedFonts.size() > 0u, "No active font set!");
141
142 if (fontSize <= 0)
143 {
144 fontSize = m_QueuedFonts[m_ActiveFontIdx].m_Font->GetFontSize();
145 }
146
147 m_NumCharacters += static_cast<uint32>(text.size());
148 m_QueuedFonts[m_ActiveFontIdx].m_TextCache.emplace_back(TextCache(text, pos, m_Color, fontSize));
149 m_QueuedFonts[m_ActiveFontIdx].m_IsAddedToRenderer = true;
150}
151
152//---------------------------------
153// TextRenderer::OnWindowResize

Callers 2

OnTickMethod · 0.80
OnRenderMethod · 0.80

Calls 2

TextCacheClass · 0.85
GetFontSizeMethod · 0.80

Tested by

no test coverage detected