FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::FloatingTextRenderer Class Reference

#include <floatingtextrenderer.h>

+ Inheritance diagram for FIFE::FloatingTextRenderer:
+ Collaboration diagram for FIFE::FloatingTextRenderer:

Public Member Functions

 FloatingTextRenderer (RenderBackend *renderbackend, int32_t position)
 Constructor. More...
 
 FloatingTextRenderer (const FloatingTextRenderer &old)
 Copy Constructor. More...
 
RendererBaseclone ()
 Makes copy of this renderer. More...
 
virtual ~FloatingTextRenderer ()
 Destructor. More...
 
void render (Camera *cam, Layer *layer, RenderList &instances)
 This method is called by the view to ask renderer to draw its rendering aspect based on given parameters. More...
 
std::string getName ()
 Returns the renderer name. More...
 
void setFont (IFont *font)
 Changes default font in the renderer Note that this does not change the font ownership. More...
 
void setColor (uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
 Changes default font color Only useful for .ttf fonts. More...
 
void setBackground (uint8_t br, uint8_t bg, uint8_t bb, uint8_t ba=255)
 Set default background quad r,g,b,a values for background. More...
 
void setBorder (uint8_t bbr, uint8_t bbg, uint8_t bbb, uint8_t bba=255)
 Set default border r,g,b,a values for border. More...
 
void resetBackground ()
 Disable the default background. More...
 
void resetBorder ()
 Disable the default border. More...
 
RenderBackendgetRenderBackend () const
 Provides access point to the RenderBackend. More...
 
- Public Member Functions inherited from FIFE::RendererBase
 RendererBase (RenderBackend *renderbackend, int32_t position)
 Constructor. More...
 
 RendererBase (const RendererBase &old)
 Copy Constructor. More...
 
virtual ~RendererBase ()
 Destructor. More...
 
int32_t getPipelinePosition () const
 Gets renderer position in the rendering pipeline. More...
 
void setPipelinePosition (int32_t position)
 Sets renderer position in the rendering pipeline Pipeline position defines in which order view calls the renderers when update occurs Note that renderers are called once per rendered layer, thus to update the whole screen, renderer might receive multiple calls. More...
 
virtual void setEnabled (bool enabled)
 Enables renderer. More...
 
virtual void reset ()
 Resets information in the renderer. More...
 
bool isEnabled () const
 Is renderer enabled. More...
 
void setRendererListener (IRendererListener *listener)
 Sets listener for renderer. More...
 
void addActiveLayer (Layer *layer)
 Adds active layer to renderer. More...
 
void removeActiveLayer (Layer *layer)
 Removes active layer from renderer. More...
 
void clearActiveLayers ()
 Clears all active layers from renderer. More...
 
void activateAllLayers (Map *elevation)
 Activates all layers from given elevation. More...
 
bool isActivedLayer (Layer *layer)
 Returns if given layer is currently activated. More...
 
std::list< Layer * > getActiveLayers () const
 Returns list of activated layer. More...
 

Static Public Member Functions

static FloatingTextRenderergetInstance (IRendererContainer *cnt)
 Gets instance for interface access. More...
 

Private Attributes

RenderBackendm_renderbackend
 
IFontm_font
 
bool m_font_color
 
SDL_Color m_color
 
bool m_background
 
bool m_backborder
 
SDL_Color m_backcolor
 
SDL_Color m_backbordercolor
 

Additional Inherited Members

- Protected Member Functions inherited from FIFE::RendererBase
 RendererBase ()
 
- Protected Attributes inherited from FIFE::RendererBase
std::list< Layer * > m_active_layers
 
RenderBackendm_renderbackend
 

Detailed Description

Definition at line 39 of file floatingtextrenderer.h.

Constructor & Destructor Documentation

FIFE::FloatingTextRenderer::FloatingTextRenderer ( RenderBackend renderbackend,
int32_t  position 
)

Constructor.

Parameters
renderbackendThe renderbackend to use.
positionThe position for this renderer in rendering pipeline. @ see setPipelinePosition

Definition at line 50 of file floatingtextrenderer.cpp.

References FIFE::RendererBase::setEnabled().

Referenced by clone().

+ Here is the caller graph for this function:

FIFE::FloatingTextRenderer::FloatingTextRenderer ( const FloatingTextRenderer old)

Copy Constructor.

Definition at line 60 of file floatingtextrenderer.cpp.

References FIFE::RendererBase::setEnabled().

FIFE::FloatingTextRenderer::~FloatingTextRenderer ( )
virtual

Destructor.

Definition at line 75 of file floatingtextrenderer.cpp.

Member Function Documentation

RendererBase * FIFE::FloatingTextRenderer::clone ( )
virtual

Makes copy of this renderer.

Implements FIFE::RendererBase.

Definition at line 71 of file floatingtextrenderer.cpp.

References FloatingTextRenderer().

FloatingTextRenderer * FIFE::FloatingTextRenderer::getInstance ( IRendererContainer cnt)
static

Gets instance for interface access.

Definition at line 174 of file floatingtextrenderer.cpp.

References FIFE::IRendererContainer::getRenderer().

Referenced by setFont().

+ Here is the caller graph for this function:

std::string FIFE::FloatingTextRenderer::getName ( )
inlinevirtual

Returns the renderer name.

Returns
The name as string.

Implements FIFE::RendererBase.

Definition at line 74 of file floatingtextrenderer.h.

RenderBackend* FIFE::FloatingTextRenderer::getRenderBackend ( ) const
inline

Provides access point to the RenderBackend.

Definition at line 110 of file floatingtextrenderer.h.

References m_renderbackend.

void FIFE::FloatingTextRenderer::render ( Camera cam,
Layer layer,
RenderList instances 
)
virtual
void FIFE::FloatingTextRenderer::resetBackground ( )

Disable the default background.

Definition at line 166 of file floatingtextrenderer.cpp.

References m_background.

Referenced by setFont().

+ Here is the caller graph for this function:

void FIFE::FloatingTextRenderer::resetBorder ( )

Disable the default border.

Definition at line 170 of file floatingtextrenderer.cpp.

References m_backborder.

Referenced by setFont().

+ Here is the caller graph for this function:

void FIFE::FloatingTextRenderer::setBackground ( uint8_t  br,
uint8_t  bg,
uint8_t  bb,
uint8_t  ba = 255 
)

Set default background quad r,g,b,a values for background.

Definition at line 148 of file floatingtextrenderer.cpp.

References m_backcolor, and m_background.

Referenced by setFont().

+ Here is the caller graph for this function:

void FIFE::FloatingTextRenderer::setBorder ( uint8_t  bbr,
uint8_t  bbg,
uint8_t  bbb,
uint8_t  bba = 255 
)

Set default border r,g,b,a values for border.

Definition at line 157 of file floatingtextrenderer.cpp.

References m_backborder, and m_backbordercolor.

Referenced by setFont().

+ Here is the caller graph for this function:

void FIFE::FloatingTextRenderer::setColor ( uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a = 255 
)

Changes default font color Only useful for .ttf fonts.

Definition at line 139 of file floatingtextrenderer.cpp.

References m_color, and m_font_color.

Referenced by setFont().

+ Here is the caller graph for this function:

void FIFE::FloatingTextRenderer::setFont ( IFont font)
inline

Changes default font in the renderer Note that this does not change the font ownership.

Definition at line 79 of file floatingtextrenderer.h.

References getInstance(), m_font, resetBackground(), resetBorder(), setBackground(), setBorder(), and setColor().

Member Data Documentation

bool FIFE::FloatingTextRenderer::m_backborder
private

Definition at line 118 of file floatingtextrenderer.h.

Referenced by render(), resetBorder(), and setBorder().

SDL_Color FIFE::FloatingTextRenderer::m_backbordercolor
private

Definition at line 120 of file floatingtextrenderer.h.

Referenced by render(), and setBorder().

SDL_Color FIFE::FloatingTextRenderer::m_backcolor
private

Definition at line 119 of file floatingtextrenderer.h.

Referenced by render(), and setBackground().

bool FIFE::FloatingTextRenderer::m_background
private

Definition at line 117 of file floatingtextrenderer.h.

Referenced by render(), resetBackground(), and setBackground().

SDL_Color FIFE::FloatingTextRenderer::m_color
private

Definition at line 116 of file floatingtextrenderer.h.

Referenced by render(), and setColor().

IFont* FIFE::FloatingTextRenderer::m_font
private

Definition at line 114 of file floatingtextrenderer.h.

Referenced by render(), and setFont().

bool FIFE::FloatingTextRenderer::m_font_color
private

Definition at line 115 of file floatingtextrenderer.h.

Referenced by render(), and setColor().

RenderBackend* FIFE::FloatingTextRenderer::m_renderbackend
private

Definition at line 113 of file floatingtextrenderer.h.

Referenced by getRenderBackend(), and render().


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