Jamie Slowgrove - AI Assignment 1
Line of Sight & A* path-finding
 All Classes Namespaces Files Functions Variables
Public Member Functions | Private Attributes | List of all members
Text Class Reference

Creates a Text Texture for use with a renderer Creates a Text Texture from an image file, this can then be used with a renderer. More...

#include <text.h>

Collaboration diagram for Text:
Collaboration graph

Public Member Functions

 Text (std::string, std::string, SDL_Renderer *, int, int, int)
 
 ~Text ()
 
SDL_Texture * getTexture ()
 
void pushToScreen (SDL_Renderer *, int, int, int, int)
 

Private Attributes

TTF_Font * font
 
SDL_Color fontColour
 
SDL_Texture * textureData
 

Detailed Description

Creates a Text Texture for use with a renderer Creates a Text Texture from an image file, this can then be used with a renderer.

Constructor & Destructor Documentation

Text::Text ( std::string  text,
std::string  fontName,
SDL_Renderer *  renderer,
int  r,
int  g,
int  b 
)

Constructs a Text Texture Creates a Text Texture using an image location and a renderer.

Parameters
std::stringThe text to display
std::stringThe location of the font file.
intThe size of the font.
SDL_Renderer*The renderer.
intThe value of red.
intThe value of green.
intThe value of blue.
Text::~Text ( )

Destructs the Text Texture Destructs the Text Texture deleting the Texture from memory.

Member Function Documentation

SDL_Texture * Text::getTexture ( )

Getter # Returns a pointer to the Texture Returns a pointer to the Texture data.

void Text::pushToScreen ( SDL_Renderer *  renderer,
int  x,
int  y,
int  width,
int  height 
)

Pushes the image to the Renderer, to the XY Coordinates. This is scaled to the width and height inputed.

Parameters
SDL_Renderer*The renderer.
intx coordinate of the image.
inty coordinate of the image.
intwidth of the scaled image.
intheight of the scaled image.

Member Data Documentation

TTF_Font* Text::font
private
SDL_Color Text::fontColour
private
SDL_Texture* Text::textureData
private

The Texture data


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