| 22 | } |
| 23 | |
| 24 | void Label::setText(const std::string_view text) { |
| 25 | if (text == _text) |
| 26 | return; |
| 27 | _text = text; |
| 28 | |
| 29 | if (_text.empty()) { |
| 30 | _texture.reset(); |
| 31 | return; |
| 32 | } |
| 33 | |
| 34 | _texture = _fontRenderer->renderText(_text, _width, _height); |
| 35 | setTextureColor(); |
| 36 | } |
| 37 | |
| 38 | void Label::setColor(const SDL_Color color) { |
| 39 | if (color.r == _color.r && color.g == _color.g && color.b == _color.b && color.a == _color.a) |
no test coverage detected