64 Text(
Font *
const font,
const char * text);
83 Text(
Font *
const font,
Texture *
const texture,
const SDL_Rect &rect,
const char * text);
186 void setColor(
const SDL_Color &color);
273 void draw(SDL_Renderer *
const renderTarget, SDL_Rect *
const renderTargetRect)
override;
SDL_Rect d_boundsRect
SDL_Rect setting the bounding rectangle for the Text object.
Definition: Text.hpp:20
A class implemented using the Facade pattern used for loading SDL TTF_Font data.
Definition: Font.hpp:17
int d_width
The width of the Text object.
Definition: Text.hpp:28
void setFlip(SDL_RendererFlip &type)
Set the flip type for the Text (SDL_FLIP_NONE, SDL_FLIP_HORIZONTAL, SDL_FLIP_VERTICAL).
Definition: Text.hpp:258
void setColor(const SDL_Color &color)
Set the color of the Font for the Text object.
Definition: Text.hpp:179
void setRenderMode(Uint32 mode, Uint32 length=0)
Set the mode for rendering the Text (renderMode::solid, renderMode::shaded, or renderMode::blended).
Definition: Text.hpp:226
Font * getFont()
Get the Font from the Text object.
Definition: Text.hpp:120
void setString(const char *str)
Set the string for the Text object.
Definition: Text.hpp:172
SDL_Color d_backgroundColor
The color of the background (bounding box) of the Text.
Definition: Text.hpp:26
renderMode
Render mode used by SDL internally to draw the Text.
Definition: Text.hpp:213
Uint32 d_renderMode
The rendering mode used to render the Text (default is renderMode::blendedWrapped).
Definition: Text.hpp:23
Text()
Inaccessible - Text needs a Font at a minimum.
Definition: Text.hpp:45
void setFont(Font *const font)
Set the Font for the Text object.
Definition: Text.hpp:113
Transform d_transform
The raw transform data for the Text object.
Definition: Text.hpp:27
void setTextData(textData &t)
Set the data for the Text object.
Definition: Text.hpp:99
Texture * getTexture()
Get the Texture from the Text object.
Definition: Text.hpp:134
const SDL_Point & getCenter()
Get the current center point of the Text.
Definition: Text.hpp:247
void setPosition(glm::vec2 pos)
Definition: Text.hpp:162
void updateTexture()
Used internally when the render mode is initialized or changed. Never call this in a loop unless you ...
Definition: Text.hpp:45
void draw(SDL_Renderer *const renderTarget, SDL_Rect *const renderTargetRect) override
Draw the Sprite to a render target.
Definition: Text.hpp:265
void setCenter(SDL_Point &point)
Set the center point for the Text.
Definition: Text.hpp:240
Drawable text using a Texture as its drawable resource. Part of the Decorator pattern along with the ...
Definition: Text.hpp:37
Font * d_font
Pointer to a Font object (memory NOT managed in this class!).
Definition: Text.hpp:18
glm::vec2 getPosition()
Definition: Text.hpp:165
const SDL_Color & getBackgroundColor()
Get the SDL_Color corresponding to the Text background color (bounding box).
Definition: Text.hpp:207
const char * d_text
The character string to render to the texture.
Definition: Text.hpp:21
Interface for creating drawable entities. Part of the Decorator pattern for drawable objects used in ...
Definition: Drawable.hpp:15
textData & getTextData()
Get the current text data for the Text object.
Definition: Text.hpp:106
const char * getString()
Get the string for the Text object.
Definition: Text.hpp:179
Uint32 m_wrapLength
If text is rendered in blended and wrapped mode, the width at which lines wrap is required...
Definition: Text.hpp:277
Uint32 getRenderMode()
Get the current render mode for the Text (default is renderMode::solid).
Definition: Text.hpp:233
SDL_Color & getColor()
Get the color of the Font for the Text object (default is white).
Definition: Text.hpp:193
int d_height
The height of the Text object.
Definition: Text.hpp:29
Texture * d_texture
Pointer to a Texture object (memory NOT managed in this class!).
Definition: Text.hpp:19
const SDL_Rect & getBoundsRect()
Get the current bounding rectangle of the Text.
Definition: Text.hpp:155
SDL_RendererFlip d_flip
An SDL_RendererFlip value setting how to flip the Text (default is SDL_FLIP_NONE).
Definition: Text.hpp:25
void setTexture(Texture *const texture)
Set the Texture for the Text object.
Definition: Text.hpp:127
void setBackgroundColor(SDL_Color c)
Set the color of the Text bounding box (background).
Definition: Text.hpp:200
void setBoundsRect(SDL_Rect &rect)
Set the bounding rectangle for the Text.
Definition: Text.hpp:141
const SDL_RendererFlip & getFlip()
Get the current flip type for the Text (default is SDL_FLIP_NONE).
Definition: Text.hpp:265
SDL_Point d_center
An SDL_Point used to set the center of the Text object.
Definition: Text.hpp:24
Data necessary for representing the Text.
Definition: Text.hpp:16
textData m_data
Data important to the construction and state maintenance of a Text.
Definition: Text.hpp:276
SDL_Color d_color
The color set to the font of the Text string (default is white).
Definition: Text.hpp:22
A class implemented using the Facade pattern used for loading SDL_Texture data.
Definition: Texture.hpp:16