random_racer::CenterScreenDisplay Class Reference

This overlay class implements 2 lines of white text in the center of the screen which get shown for a given amount of time and will then fade out smoothly. More...

#include <CenterScreenDisplay.h>

Inheritance diagram for random_racer::CenterScreenDisplay:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 CenterScreenDisplay (VRS::SO< VRS::Canvas > canvas)
 Ctor.
virtual ~CenterScreenDisplay ()
 Dtor.
void showText (unsigned int msecs, const std::string &line1, const std::string &line2=std::string())
 Shows the given 2 lines of text for msecs milliseconds.

Private Member Functions

virtual void timerTick ()
 This is the method the timer calls and which fades out the text periodically.
void handleResizeEvents ()
 This class replaces the camera on ResizeEvents, so that the text always stays at the same size in the center of the screen.

Private Attributes

VRS::SO< VRS::SceneThing > m_thing
VRS::SO< VRS::Font > m_font
VRS::SO< VRS::BehaviorCallback > m_eventCallback
VRS::SO< VRS::Camera > m_cam
VRS::SO< VRS::ShapeMaterialGL > m_material
VRS::SO< VRS::Text > m_line1
VRS::SO< VRS::Text > m_line2
bool m_newTimer

Static Private Attributes

static const float c_pixelsPerChar

Detailed Description

This overlay class implements 2 lines of white text in the center of the screen which get shown for a given amount of time and will then fade out smoothly.

Definition at line 30 of file CenterScreenDisplay.h.


Constructor & Destructor Documentation

random_racer::CenterScreenDisplay::CenterScreenDisplay ( VRS::SO< VRS::Canvas >  canvas  ) 

Ctor.

random_racer::CenterScreenDisplay::~CenterScreenDisplay (  )  [virtual]

Dtor.

Definition at line 68 of file CenterScreenDisplay.cpp.


Member Function Documentation

void random_racer::CenterScreenDisplay::timerTick (  )  [private, virtual]

This is the method the timer calls and which fades out the text periodically.

Implements random_utils::TimeableObject.

Definition at line 73 of file CenterScreenDisplay.cpp.

References m_material, m_newTimer, m_thing, random_utils::TimeableObject::startTimer(), and random_utils::TimeableObject::stopTimer().

Here is the call graph for this function:

void random_racer::CenterScreenDisplay::handleResizeEvents (  )  [private]

This class replaces the camera on ResizeEvents, so that the text always stays at the same size in the center of the screen.

Definition at line 103 of file CenterScreenDisplay.cpp.

References c_pixelsPerChar, m_cam, m_eventCallback, and m_thing.

void random_racer::CenterScreenDisplay::showText ( unsigned int  msecs,
const std::string &  line1,
const std::string &  line2 = std::string() 
)

Shows the given 2 lines of text for msecs milliseconds.

Definition at line 124 of file CenterScreenDisplay.cpp.

References m_line1, m_line2, m_material, m_newTimer, m_thing, and random_utils::TimeableObject::startTimer().

Here is the call graph for this function:


Member Data Documentation

VRS::SO<VRS::SceneThing> random_racer::CenterScreenDisplay::m_thing [private]

Definition at line 33 of file CenterScreenDisplay.h.

Referenced by handleResizeEvents(), showText(), and timerTick().

VRS::SO<VRS::Font> random_racer::CenterScreenDisplay::m_font [private]

Definition at line 34 of file CenterScreenDisplay.h.

VRS::SO<VRS::BehaviorCallback> random_racer::CenterScreenDisplay::m_eventCallback [private]

Definition at line 35 of file CenterScreenDisplay.h.

Referenced by handleResizeEvents().

VRS::SO<VRS::Camera> random_racer::CenterScreenDisplay::m_cam [private]

Definition at line 36 of file CenterScreenDisplay.h.

Referenced by handleResizeEvents().

VRS::SO<VRS::ShapeMaterialGL> random_racer::CenterScreenDisplay::m_material [private]

Definition at line 37 of file CenterScreenDisplay.h.

Referenced by showText(), and timerTick().

VRS::SO<VRS::Text> random_racer::CenterScreenDisplay::m_line1 [private]

Definition at line 38 of file CenterScreenDisplay.h.

Referenced by showText().

VRS::SO<VRS::Text> random_racer::CenterScreenDisplay::m_line2 [private]

Definition at line 38 of file CenterScreenDisplay.h.

Referenced by showText().

bool random_racer::CenterScreenDisplay::m_newTimer [private]

Definition at line 39 of file CenterScreenDisplay.h.

Referenced by showText(), and timerTick().

const float random_racer::CenterScreenDisplay::c_pixelsPerChar [static, private]

Definition at line 41 of file CenterScreenDisplay.h.

Referenced by handleResizeEvents().


The documentation for this class was generated from the following files:
Generated on Fri May 11 21:02:06 2007 for Random Racer by  doxygen 1.5.1