Bubba-3D  0.9.0
Awesome game engine!
Public Member Functions | Protected Attributes | List of all members
TextObject Class Reference

#include <TextObject.h>

Inheritance diagram for TextObject:
IHudDrawable

Public Member Functions

 TextObject (std::string text, Font *font, int width, int height, int x, int y)
 
virtual void render (ShaderProgram *shaderProgram, chag::float4x4 *projectionMatrix)
 
virtual void setText (std::string text)
 
- Public Member Functions inherited from IHudDrawable
virtual void setRelativePosition (chag::float3 position)
 
virtual void setCenterOffset (chag::float3 offset)
 
virtual void setRotation (float rotation)
 
virtual void setScale (chag::float2 scale)
 

Protected Attributes

std::string text
 
Fontfont
 
int width
 
int height
 
int x
 
int y
 
int numVertices
 
GLuint vao
 
GLuint vbo
 
bool buffersInitiated = false
 
- Protected Attributes inherited from IHudDrawable
chag::float3 center = chag::make_vector(0.0f, 0.0f, 0.0f)
 
float rotation = 0.0f
 
chag::float3 originalPosition = chag::make_vector(0.0f, 0.0f, 0.0f)
 
chag::float3 scale = chag::make_vector(1.0f,1.0f,1.0f)
 

Additional Inherited Members

- Public Attributes inherited from IHudDrawable
chag::float3 relativePosition = chag::make_vector(0.0f, 0.0f, 0.0f)
 

Detailed Description

A low-level OpenGL object that renders text within the specified dimensions.

Definition at line 26 of file TextObject.h.

Constructor & Destructor Documentation

TextObject::TextObject ( std::string  text,
Font font,
int  width,
int  height,
int  x,
int  y 
)

Creates a text object that should be rendered at position (x,y). The coordinates are screen-type 2D coordinates when used with the HudRenderer (see HudRenderer).

Definition at line 26 of file TextObject.cpp.

Member Function Documentation

void TextObject::render ( ShaderProgram shaderProgram,
chag::float4x4 *  projectionMatrix 
)
virtual

Renders the object using the specified shader program and projection matrix. The shader should have the same variables as the default hud.vert and hud.frag.

Implements IHudDrawable.

Definition at line 179 of file TextObject.cpp.

void TextObject::setText ( std::string  text)
virtual

Changes the text of the TextObject.

Definition at line 31 of file TextObject.cpp.


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