MCPcopy Create free account
hub / github.com/axmolengine/axmol / setInactiveText

Method setInactiveText

core/ui/UIEditBox/UIEditBoxImpl-common.cpp:139–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139void EditBoxImplCommon::setInactiveText(const char* pText)
140{
141 if (EditBox::InputFlag::PASSWORD == _editBoxInputFlag)
142 {
143 std::string passwordString;
144 for (size_t i = 0, len = strlen(pText); i < len; ++i)
145 passwordString.append(PASSWORD_CHAR);
146 _label->setString(passwordString);
147 }
148 else
149 {
150 _label->setString(pText);
151 }
152 // Clip the text width to fit to the text box
153 const auto maxSize = applyPadding(_editBox->getContentSize());
154 Vec2 labelSize = _label->getContentSize();
155 if (labelSize.width > maxSize.width || labelSize.height > maxSize.height)
156 {
157 _label->setDimensions(maxSize.width, maxSize.height);
158 }
159}
160
161void EditBoxImplCommon::setFont(const char* pFontName, int fontSize)
162{

Callers

nothing calls this directly

Calls 5

applyPaddingFunction · 0.85
appendMethod · 0.45
setStringMethod · 0.45
getContentSizeMethod · 0.45
setDimensionsMethod · 0.45

Tested by

no test coverage detected