HoverRace  2.0
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
HoverRace::Display::SDL::SdlLabelView Class Reference

#include <SdlLabelView.h>

+ Inheritance diagram for HoverRace::Display::SDL::SdlLabelView:

Public Member Functions

 SdlLabelView (SdlDisplay &disp, Label &model)
 
virtual ~SdlLabelView ()
 
Vec3 Measure () override
 
void OnModelUpdate (int prop) override
 Called by the view model to indicate that a property has changed. More...
 
void PrepareRender () override
 
void Render () override
 
- Public Member Functions inherited from HoverRace::Display::SDL::SdlView< Label >
 SdlView (SdlDisplay &display, Label &model)
 
virtual ~SdlView ()
 
- Public Member Functions inherited from HoverRace::Display::View
virtual ~View ()
 
virtual Vec2 GetScreenPos () const
 Retrieve the screen-space position, if available. More...
 
virtual Vec2 GetScreenSize () const
 Retrieve the screen-space size, if available. More...
 
Viewoperator= (const View &)=delete
 

Private Types

using SUPER = SdlView< Label >
 

Private Member Functions

void UpdateBlank ()
 Update the state when the text is an empty string. More...
 
void UpdateTexture ()
 
void UpdateTextureColor ()
 

Private Attributes

bool colorChanged
 
int height
 
int realHeight
 
int realWidth
 
std::unique_ptr< SdlTexturetexture
 
boost::signals2::scoped_connection uiScaleChangedConnection
 
double unscaledHeight
 
double unscaledWidth
 
int width
 

Additional Inherited Members

- Protected Attributes inherited from HoverRace::Display::SDL::SdlView< Label >
SdlDisplaydisplay
 
Labelmodel
 

Member Typedef Documentation

Constructor & Destructor Documentation

HoverRace::Display::SDL::SdlLabelView::SdlLabelView ( SdlDisplay disp,
Label model 
)
HoverRace::Display::SDL::SdlLabelView::~SdlLabelView ( )
virtual

Member Function Documentation

Vec3 HoverRace::Display::SDL::SdlLabelView::Measure ( )
overridevirtual
void HoverRace::Display::SDL::SdlLabelView::OnModelUpdate ( int  prop)
overridevirtual

Called by the view model to indicate that a property has changed.

The view can use this to decide if view-specific resources need to be reloaded.

Parameters
propThe model-specific ID of the property that changed.

Reimplemented from HoverRace::Display::View.

void HoverRace::Display::SDL::SdlLabelView::PrepareRender ( )
overridevirtual
void HoverRace::Display::SDL::SdlLabelView::Render ( )
overridevirtual
void HoverRace::Display::SDL::SdlLabelView::UpdateBlank ( )
private

Update the state when the text is an empty string.

In this case, we measure the height of the string, and set the width to be 1 (to prevent accidental divisions by zero).

void HoverRace::Display::SDL::SdlLabelView::UpdateTexture ( )
private
void HoverRace::Display::SDL::SdlLabelView::UpdateTextureColor ( )
private

Member Data Documentation

bool HoverRace::Display::SDL::SdlLabelView::colorChanged
private
int HoverRace::Display::SDL::SdlLabelView::height
private
int HoverRace::Display::SDL::SdlLabelView::realHeight
private
int HoverRace::Display::SDL::SdlLabelView::realWidth
private
std::unique_ptr<SdlTexture> HoverRace::Display::SDL::SdlLabelView::texture
private
boost::signals2::scoped_connection HoverRace::Display::SDL::SdlLabelView::uiScaleChangedConnection
private
double HoverRace::Display::SDL::SdlLabelView::unscaledHeight
private
double HoverRace::Display::SDL::SdlLabelView::unscaledWidth
private
int HoverRace::Display::SDL::SdlLabelView::width
private

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