Creates a Text Texture for use with a renderer using the Text formating.
More...
#include <C_Text.h>
|
| C_Text (std::string text, std::string fontLocation, SDL_Renderer *renderer) |
| Constructs the Text Texture. Font size and colour will be default (size 10 and black). More...
|
|
| C_Text (std::string text, std::string fontLocation, int fontSize, SDL_Renderer *renderer) |
| Constructs the Text Texture. Font colour will be default (black). More...
|
|
| C_Text (std::string text, std::string fontLocation, SDL_Renderer *renderer, int r, int g, int b) |
| Constructs the Text Texture. Font size will be default (size 10). More...
|
|
| C_Text (std::string text, std::string fontLocation, SDL_Renderer *renderer, SDL_Colour fontColour) |
| Constructs the Text Texture. Font size will be default (size 10). More...
|
|
| C_Text (std::string text, std::string fontLocation, int fontSize, SDL_Renderer *renderer, int r, int g, int b) |
| Constructs the Text Texture. More...
|
|
| C_Text (std::string text, std::string fontLocation, int fontSize, SDL_Renderer *renderer, SDL_Colour fontColour) |
| Constructs the Text Texture. More...
|
|
| ~C_Text () |
| Destructs the Text Texture. More...
|
|
void | pushToScreen (C_Vec2 pos) |
| Pushes the Text Texture to the Renderer to the XY Coordinates. More...
|
|
void | setColour (int r, int g, int b) |
| Sets the colour of the text. More...
|
|
void | setColour (SDL_Colour colour) |
| Sets the colour of the text. More...
|
|
void | setFontSize (int fontSize) |
| Sets the font size of the text. More...
|
|
void | setFont (std::string fontLocation) |
| Sets the font of the text. More...
|
|
void | setText (std::string text) |
| Sets the text. More...
|
|
C_Vec2 | getDimensions () |
| Gets the dimensions of the Text Texture. More...
|
|
Creates a Text Texture for use with a renderer using the Text formating.
- Author
- Jamie Slowgrove
C_Text::C_Text |
( |
std::string |
text, |
|
|
std::string |
fontLocation, |
|
|
SDL_Renderer * |
renderer |
|
) |
| |
Constructs the Text Texture. Font size and colour will be default (size 10 and black).
- Parameters
-
text | The text to display. |
fontLocation | The location of the font file. |
renderer | The renderer. |
C_Text::C_Text |
( |
std::string |
text, |
|
|
std::string |
fontLocation, |
|
|
int |
fontSize, |
|
|
SDL_Renderer * |
renderer |
|
) |
| |
Constructs the Text Texture. Font colour will be default (black).
- Parameters
-
text | The text to display. |
fontLocation | The location of the font file. |
fontSize | The size of the font. |
renderer | The renderer. |
C_Text::C_Text |
( |
std::string |
text, |
|
|
std::string |
fontLocation, |
|
|
SDL_Renderer * |
renderer, |
|
|
int |
r, |
|
|
int |
g, |
|
|
int |
b |
|
) |
| |
Constructs the Text Texture. Font size will be default (size 10).
- Parameters
-
text | The text to display. |
fontLocation | The location of the font file. |
renderer | The renderer. |
r | The value of red. (0-255) |
g | The value of green. (0-255) |
b | The value of blue. (0-255) |
C_Text::C_Text |
( |
std::string |
text, |
|
|
std::string |
fontLocation, |
|
|
SDL_Renderer * |
renderer, |
|
|
SDL_Colour |
fontColour |
|
) |
| |
Constructs the Text Texture. Font size will be default (size 10).
- Parameters
-
text | The text to display. |
fontLocation | The location of the font file. |
renderer | The renderer. |
fontColour | The colour of the font. |
C_Text::C_Text |
( |
std::string |
text, |
|
|
std::string |
fontLocation, |
|
|
int |
fontSize, |
|
|
SDL_Renderer * |
renderer, |
|
|
int |
r, |
|
|
int |
g, |
|
|
int |
b |
|
) |
| |
Constructs the Text Texture.
- Parameters
-
text | The text to display. |
fontLocation | The location of the font file. |
fontSize | The size of the font. |
renderer | The renderer. |
r | The value of red. (0-255) |
g | The value of green. (0-255) |
b | The value of blue. (0-255) |
C_Text::C_Text |
( |
std::string |
text, |
|
|
std::string |
fontLocation, |
|
|
int |
fontSize, |
|
|
SDL_Renderer * |
renderer, |
|
|
SDL_Colour |
fontColour |
|
) |
| |
Constructs the Text Texture.
- Parameters
-
text | The text to display. |
fontLocation | The location of the font file. |
fontSize | The size of the font. |
renderer | The renderer. |
fontColour | The colour of the font. |
Destructs the Text Texture.
void C_Text::createTextTexture |
( |
| ) |
|
|
private |
Creates a Text Texture using the Text data.
C_Vec2 C_Text::getDimensions |
( |
| ) |
|
Gets the dimensions of the Text Texture.
- Returns
- The dimensions of the Text Texture.
void C_Text::pushToScreen |
( |
C_Vec2 |
pos | ) |
|
Pushes the Text Texture to the Renderer to the XY Coordinates.
- Parameters
-
pos | The position to push the Text Texture to. |
void C_Text::setColour |
( |
int |
r, |
|
|
int |
g, |
|
|
int |
b |
|
) |
| |
Sets the colour of the text.
- Parameters
-
r | The value of red. (0-255) |
g | The value of green. (0-255) |
b | The value of blue. (0-255) |
void C_Text::setColour |
( |
SDL_Colour |
colour | ) |
|
Sets the colour of the text.
- Parameters
-
colour | The colour of the font. |
void C_Text::setFont |
( |
std::string |
fontLocation | ) |
|
Sets the font of the text.
- Parameters
-
fontLocation | The location of the font file. |
void C_Text::setFontSize |
( |
int |
fontSize | ) |
|
Sets the font size of the text.
- Parameters
-
fontSize | The font size of the text. |
void C_Text::setText |
( |
std::string |
text | ) |
|
Sets the text.
- Parameters
-
SDL_Colour C_Text::fontColour |
|
private |
std::string C_Text::fontLocation |
|
private |
SDL_Renderer* C_Text::renderer |
|
private |
The text and font location.
SDL_Texture* C_Text::textureData |
|
private |
The documentation for this class was generated from the following files: