MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / setText

Method setText

Source/TextButton.cpp:78–87  ·  view source on GitHub ↗

Getters and Setters

Source from the content-addressed store, hash-verified

76
77// Getters and Setters
78void TextButton::setText(std::string_view text) {
79 this->m_pText->setString(text);
80
81 this->m_pBG->setContentSize({
82 (this->m_fWidth == 0) ? this->m_pText->getContentSize().width + 32 : this->m_fWidth,
83 (this->m_fHeight == 0) ? this->m_pText->getContentSize().height + 32 : this->m_fHeight
84 });
85
86 this->m_pText->setPosition(this->m_pBG->getContentSize() / 2);
87}
88
89Label* TextButton::getLabel()
90{

Callers

nothing calls this directly

Calls 2

setPositionMethod · 0.80
setStringMethod · 0.45

Tested by

no test coverage detected