SDL SPOOKY PLATFORMER ENGINE  0.2.0
An implementation of a platformer using sdl, implemented using an entity component system and efficient collision management.
Public Member Functions | List of all members
BasicTextComponent Class Reference

#include <BasicTextComponent.hpp>

Inheritance diagram for BasicTextComponent:
Component

Public Member Functions

 BasicTextComponent (SDL_Point position, SDL_Renderer *renderer, std::shared_ptr< TTF_Font > font, SDL_Color &color, TextUpdate *updateFunc)
 
 ~BasicTextComponent ()
 clean up a text object More...
 
void SetText (const std::wstring &text)
 
void Render (SDL_Renderer *ren)
 
SDL_Rect TextDims ()
 
void Update (float deltaTime)
 Update this component according to the deltaTime. More...
 
 BasicTextComponent (BasicTextComponent &text) = delete
 don't allow accidental copies which may create unfortunate references. More...
 
- Public Member Functions inherited from Component
 Component ()
 
virtual ~Component ()
 

Additional Inherited Members

- Protected Attributes inherited from Component
GameObjectentity
 The entitity to which this component belongs to. More...
 

Detailed Description

Basic implementation of general text objects. Once created a text object is fixed in place, however the actual text it renders can change.

Constructor & Destructor Documentation

BasicTextComponent::BasicTextComponent ( SDL_Point  position,
SDL_Renderer *  renderer,
std::shared_ptr< TTF_Font >  font,
SDL_Color &  color,
TextUpdate updateFunc 
)

Constructs a text object.

Parameters
positionwhere its anchor point is
rendererrenderer to target when drawing
fontwhat font to draw it in
colorwhat color to draw it in
BasicTextComponent::~BasicTextComponent ( )

clean up a text object

BasicTextComponent::BasicTextComponent ( BasicTextComponent &  text)
delete

don't allow accidental copies which may create unfortunate references.

Member Function Documentation

void BasicTextComponent::Render ( SDL_Renderer *  ren)
virtual

Render text to screen.

Reimplemented from Component.

void BasicTextComponent::SetText ( const std::wstring &  text)

Set the text to render.

Parameters
textstring to render
SDL_Rect BasicTextComponent::TextDims ( )

Return the dimensions of this text object.

void BasicTextComponent::Update ( float  deltaTime)
virtual

Update this component according to the deltaTime.

Implements Component.


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