replace kFont with std::string
This commit is contained in:
@@ -31,16 +31,14 @@ void NodeText::create()
|
||||
Node::create();
|
||||
if (!m_font.empty())
|
||||
{
|
||||
char font[64];
|
||||
sprintf(font, "%s-%d", m_font.c_str(), m_font_size);
|
||||
font_id = (kFont)const_hash(font);
|
||||
font_id = fmt::format("{}-{}", m_font, m_font_size);
|
||||
m_text_mesh.create();
|
||||
m_text_mesh.update(font_id, m_text);
|
||||
update_layout();
|
||||
}
|
||||
}
|
||||
|
||||
void NodeText::set_font(kFont fontID)
|
||||
void NodeText::set_font(const std::string& fontID)
|
||||
{
|
||||
font_id = fontID;
|
||||
m_text_mesh.create();
|
||||
|
||||
Reference in New Issue
Block a user