Sky Zone Omega - PC Version
 All Classes Namespaces Files Functions Variables Macros
Public Member Functions | Private Member Functions | Private Attributes | List of all members
C_Text Class Reference

Creates a Text Texture for use with a renderer using the Text formating. More...

#include <C_Text.h>

Collaboration diagram for C_Text:
Collaboration graph

Public Member Functions

 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...
 

Private Member Functions

void createTextTexture ()
 Creates a Text Texture using the Text data. More...
 

Private Attributes

TTF_Font * font
 Font. More...
 
SDL_Colour fontColour
 Font colour. More...
 
SDL_Texture * textureData
 The Texture data. More...
 
SDL_Renderer * renderer
 A pointer to the render. More...
 
int fontSize
 Font size. More...
 
std::string text
 The text and font location. More...
 
std::string fontLocation
 
C_Vec2 dimensions
 The Texture dimensions. More...
 

Detailed Description

Creates a Text Texture for use with a renderer using the Text formating.

Author
Jamie Slowgrove

Constructor & Destructor Documentation

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
textThe text to display.
fontLocationThe location of the font file.
rendererThe renderer.

Here is the call graph for this function:

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
textThe text to display.
fontLocationThe location of the font file.
fontSizeThe size of the font.
rendererThe renderer.

Here is the call graph for this function:

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
textThe text to display.
fontLocationThe location of the font file.
rendererThe renderer.
rThe value of red. (0-255)
gThe value of green. (0-255)
bThe value of blue. (0-255)

Here is the call graph for this function:

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
textThe text to display.
fontLocationThe location of the font file.
rendererThe renderer.
fontColourThe colour of the font.

Here is the call graph for this function:

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
textThe text to display.
fontLocationThe location of the font file.
fontSizeThe size of the font.
rendererThe renderer.
rThe value of red. (0-255)
gThe value of green. (0-255)
bThe value of blue. (0-255)

Here is the call graph for this function:

C_Text::C_Text ( std::string  text,
std::string  fontLocation,
int  fontSize,
SDL_Renderer *  renderer,
SDL_Colour  fontColour 
)

Constructs the Text Texture.

Parameters
textThe text to display.
fontLocationThe location of the font file.
fontSizeThe size of the font.
rendererThe renderer.
fontColourThe colour of the font.

Here is the call graph for this function:

C_Text::~C_Text ( )

Destructs the Text Texture.

Member Function Documentation

void C_Text::createTextTexture ( )
private

Creates a Text Texture using the Text data.

Here is the caller graph for this function:

C_Vec2 C_Text::getDimensions ( )

Gets the dimensions of the Text Texture.

Returns
The dimensions of the Text Texture.

Here is the caller graph for this function:

void C_Text::pushToScreen ( C_Vec2  pos)

Pushes the Text Texture to the Renderer to the XY Coordinates.

Parameters
posThe position to push the Text Texture to.

Here is the caller graph for this function:

void C_Text::setColour ( int  r,
int  g,
int  b 
)

Sets the colour of the text.

Parameters
rThe value of red. (0-255)
gThe value of green. (0-255)
bThe value of blue. (0-255)

Here is the call graph for this function:

void C_Text::setColour ( SDL_Colour  colour)

Sets the colour of the text.

Parameters
colourThe colour of the font.

Here is the call graph for this function:

void C_Text::setFont ( std::string  fontLocation)

Sets the font of the text.

Parameters
fontLocationThe location of the font file.

Here is the call graph for this function:

void C_Text::setFontSize ( int  fontSize)

Sets the font size of the text.

Parameters
fontSizeThe font size of the text.

Here is the call graph for this function:

void C_Text::setText ( std::string  text)

Sets the text.

Parameters
textThe text to display.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

C_Vec2 C_Text::dimensions
private

The Texture dimensions.

TTF_Font* C_Text::font
private

Font.

SDL_Colour C_Text::fontColour
private

Font colour.

std::string C_Text::fontLocation
private
int C_Text::fontSize
private

Font size.

SDL_Renderer* C_Text::renderer
private

A pointer to the render.

std::string C_Text::text
private

The text and font location.

SDL_Texture* C_Text::textureData
private

The Texture data.


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