SDL Breakout Engine
0.1.0
An implementation of a Breakout game using sdl, implemented with efficient resource management.
|
#include <BasicText.hpp>
Public Member Functions | |
BasicText (SDL_Point position, SDL_Renderer *renderer, std::shared_ptr< TTF_Font > font, SDL_Color &color) | |
~BasicText () | |
clean up a text object More... | |
void | SetText (const std::wstring &text) |
void | Draw () |
SDL_Rect | TextDims () |
BasicText (BasicText &text) = delete | |
don't allow accidental copies which may create unfortunate references. More... | |
Basic implementation of general text objects. Once created a text object is fixed in place, however the actual text it renders can change.
BasicText::BasicText | ( | SDL_Point | position, |
SDL_Renderer * | renderer, | ||
std::shared_ptr< TTF_Font > | font, | ||
SDL_Color & | color | ||
) |
Constructs a text object.
position | where its anchor point is |
renderer | renderer to target when drawing |
font | what font to draw it in |
color | what color to draw it in |
BasicText::~BasicText | ( | ) |
clean up a text object
|
delete |
don't allow accidental copies which may create unfortunate references.
void BasicText::Draw | ( | ) |
Render text to screen.
void BasicText::SetText | ( | const std::wstring & | text | ) |
Set the text to render.
text | string to render |
SDL_Rect BasicText::TextDims | ( | ) |
Return the dimensions of this text object.