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

Method placeInactiveLabels

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

Source from the content-addressed store, hash-verified

111}
112
113void EditBoxImplCommon::placeInactiveLabels(const Vec2& size)
114{
115 _label->setDimensions(size.width, size.height);
116
117 auto placeholderSize = _labelPlaceHolder->getContentSize();
118
119 if (_editBoxInputMode == EditBox::InputMode::ANY)
120 {
121 _label->setPosition(Vec2((float)AX_EDIT_BOX_PADDING, size.height - AX_EDIT_BOX_PADDING));
122 _label->setVerticalAlignment(TextVAlignment::TOP);
123 _label->enableWrap(true);
124
125 _labelPlaceHolder->setPosition(Vec2((float)AX_EDIT_BOX_PADDING, size.height - AX_EDIT_BOX_PADDING));
126 _labelPlaceHolder->setVerticalAlignment(TextVAlignment::TOP);
127 }
128 else
129 {
130 _label->enableWrap(false);
131 _label->setPosition(Vec2((float)AX_EDIT_BOX_PADDING, size.height));
132 _label->setVerticalAlignment(TextVAlignment::CENTER);
133
134 _labelPlaceHolder->setPosition(Vec2((float)AX_EDIT_BOX_PADDING, (size.height + placeholderSize.height) / 2));
135 _labelPlaceHolder->setVerticalAlignment(TextVAlignment::CENTER);
136 }
137}
138
139void EditBoxImplCommon::setInactiveText(const char* pText)
140{

Callers 1

setInputModeMethod · 0.95

Calls 6

setVerticalAlignmentMethod · 0.80
enableWrapMethod · 0.80
Vec2Function · 0.50
setDimensionsMethod · 0.45
getContentSizeMethod · 0.45
setPositionMethod · 0.45

Tested by

no test coverage detected