Updates the displayed label
| 242 | |
| 243 | // Updates the displayed label |
| 244 | void TextInputNode::updateDisplayedLabel() |
| 245 | { |
| 246 | if (!_displayedLabel || !_cursor) |
| 247 | return; |
| 248 | |
| 249 | if (_textField->getString().empty()) |
| 250 | { |
| 251 | _displayedLabel->setString(_placeholderString); |
| 252 | _displayedLabel->setColor(_placeholderColor); |
| 253 | } |
| 254 | else |
| 255 | { |
| 256 | _displayedLabel->setString(_textField->getString()); |
| 257 | _displayedLabel->setColor(_textColor); |
| 258 | } |
| 259 | |
| 260 | updateDisplayedLabelScale(); |
| 261 | } |
| 262 | |
| 263 | // Updates the displayed label's scale |
| 264 | void TextInputNode::updateDisplayedLabelScale() |