ge211
Text_sprite Class Reference

Detailed Description

A Sprite that displays text.

Definition at line 182 of file ge211_sprites.h.

+ Inheritance diagram for Text_sprite:

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.
 

Constructor & Destructor Documentation

◆ Text_sprite() [1/2]

Constructs an empty text sprite.

This is useful when you don't know the message at the point where the sprite is created, but note that passing an empty text sprite to Sprite_set::add_sprite(Sprite const&, Position, int) is an error.

Definition at line 230 of file ge211_sprites.cpp.

◆ Text_sprite() [2/2]

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 233 of file ge211_sprites.cpp.


The documentation for this class was generated from the following files: