A Sprite that displays text.
Definition at line 231 of file ge211_sprites.hxx.
Classes | |
class | Builder |
Builder-style API for configuring and constructing Text_sprites. More... | |
Public Member Functions | |
Text_sprite () | |
Constructs an empty text sprite. More... | |
Text_sprite (std::string const &, Font const &) | |
Constructs a white text sprite with the given text and font. More... | |
bool | empty () const |
Is this Text_sprite empty? (If so, you shouldn't try to use it.) | |
operator bool () const | |
Is this Text_sprite non-empty (and thus renderable)? | |
void | reconfigure (Builder const &) |
Resets this text sprite with the configuration from the given Builder. | |
Text_sprite | ( | ) |
Constructs an empty text sprite.
This is useful when you don't yet know the message at the point where the sprite is created. It's an error to pass the an empty Text_sprite to Sprite_set::add_sprite(Sprite const&, Posn<int>, int, Transform), but you can use Text_sprite::reconfigure(Builder const&) to make it non-empty.
Definition at line 239 of file ge211_sprites.cxx.
Text_sprite | ( | std::string const & | message, |
Font const & | font | ||
) |
Constructs a white text sprite with the given text and font.
For more control (color, wrapping, turning off anti-aliasing), use the Builder API instead.
While it is okay to construct a text sprite with no text, it cannot be rendered into a scene. Use empty() const to check if you haven't kept track.
Definition at line 242 of file ge211_sprites.cxx.