Castor3D  ..
Classes | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Castor3D::TextOverlay Class Reference

An overlay with a text. More...

+ Inheritance diagram for Castor3D::TextOverlay:
+ Collaboration diagram for Castor3D::TextOverlay:

Classes

class  BinaryParser
 TextOverlay loader. More...
 
class  TextLoader
 TextOverlay loader. More...
 
struct  Vertex
 Holds specific vertex data for a TextOverlay. More...
 

Public Member Functions

 DECLARE_VECTOR (Vertex, Vertex)
 
 DECLARE_MAP (char32_t, Castor::Position, GlyphPosition)
 
C3D_API TextOverlay ()
 Constructor. More...
 
virtual C3D_API ~TextOverlay ()
 Destructor. More...
 
C3D_API void SetFont (Castor::String const &p_strFont)
 Sets the text font. More...
 
C3D_API Castor::String const & GetFontName () const
 Retrieves the font name. More...
 
virtual C3D_API bool IsChanged () const
 
FontTextureSPtr GetFontTexture () const
 
VertexArray const & GetTextVertex () const
 Retrieves the panel vertex buffer. More...
 
Castor::String GetCaption () const
 Retrieves the overlay text. More...
 
void SetCaption (Castor::String const &p_caption)
 Sets the overlay text. More...
 
void SetCaption (Castor::OutputStream const &p_caption)
 Sets the overlay text. More...
 
void SetTextWrappingMode (eTEXT_WRAPPING_MODE p_mode)
 Sets text wrapping mode. More...
 
eHALIGN GetHAlign () const
 Retrieves the horizontal alignment. More...
 
eVALIGN GetVAlign () const
 Retrieves the vertical alignment. More...
 
void SetHAlign (eHALIGN p_align)
 Defines the horizontal alignment. More...
 
void SetVAlign (eVALIGN p_align)
 Defines the vertical alignment. More...
 
void SetTexturingMode (eTEXT_TEXTURING_MODE p_mode)
 Defines the text texture mapping mode. More...
 
- Public Member Functions inherited from Castor3D::OverlayCategory
 DECLARE_VECTOR (Vertex, Vertex)
 
C3D_API OverlayCategory (eOVERLAY_TYPE p_type)
 Constructor. More...
 
virtual C3D_API ~OverlayCategory ()
 Destructor. More...
 
C3D_API void Update ()
 Updates the overlay position, size... More...
 
C3D_API void Render ()
 Draws the overlay. More...
 
virtual C3D_API void SetMaterial (MaterialSPtr p_pMaterial)
 Sets the material. More...
 
C3D_API Castor::String const & GetOverlayName () const
 Retrieves the overlay name. More...
 
C3D_API Castor::Position GetAbsolutePosition (Castor::Size const &p_size) const
 Retrieves the absolute overlay position, in pixels. More...
 
C3D_API Castor::Size GetAbsoluteSize (Castor::Size const &p_size) const
 Retrieves the absolute overlay size, in pixels. More...
 
C3D_API Castor::Point2d GetAbsolutePosition () const
 Retrieves the absolute overlay position. More...
 
C3D_API Castor::Point2d GetAbsoluteSize () const
 Retrieves the absolute overlay size. More...
 
C3D_API bool IsSizeChanged () const
 
C3D_API bool IsPositionChanged () const
 
void SetPosition (Castor::Point2d const &p_position)
 Sets the overlay position. More...
 
void SetSize (Castor::Point2d const &p_size)
 Sets the overlay size. More...
 
Castor::Point2d const & GetSize () const
 Retrieves the overlay size. More...
 
Castor::Point2d const & GetPosition () const
 Retrieves the overlay position. More...
 
Castor::Size const & GetPixelSize () const
 Retrieves the overlay size. More...
 
Castor::Position const & GetPixelPosition () const
 Retrieves the overlay position. More...
 
Castor::Point2d & GetSize ()
 Retrieves the overlay size. More...
 
Castor::Point2d & GetPosition ()
 Retrieves the overlay position. More...
 
Castor::Size & GetPixelSize ()
 Retrieves the overlay size. More...
 
Castor::Position & GetPixelPosition ()
 Retrieves the overlay position. More...
 
eOVERLAY_TYPE GetType () const
 Retrieves the overlay type. More...
 
bool IsVisible () const
 Retrieves the visibility status. More...
 
MaterialSPtr GetMaterial () const
 Retrieves the material. More...
 
int GetIndex () const
 Retrieves the index. More...
 
int GetLevel () const
 Retrieves the level. More...
 
Overlay const & GetOverlay () const
 Retrieves the overlay. More...
 
OverlayGetOverlay ()
 Retrieves the overlay. More...
 
void SetOverlay (Overlay *val)
 Sets the overlay. More...
 
void SetVisible (bool val)
 Sets the visibility status. More...
 
void SetPixelPosition (Castor::Position const &val)
 Sets the overlay position. More...
 
void SetPixelSize (Castor::Size const &val)
 Sets the overlay size. More...
 
void SetOrder (int p_index, int p_level)
 Sets the overlay order. More...
 
void SetUV (Castor::Point4d const &val)
 Sets the overlay UV. More...
 
Castor::Point4d const & GetUV () const
 Retrieves the overlay UV. More...
 

Static Public Member Functions

static C3D_API OverlayCategorySPtr Create ()
 Creation function, used by the factory. More...
 

Protected Attributes

VertexArray m_arrayVtx
 The vertex buffer data. More...
 
Castor::String m_currentCaption
 The current overlay caption. More...
 
Castor::String m_previousCaption
 The previous overlay caption. More...
 
FontTextureWPtr m_fontTexture
 The texture associated to the overlay font. More...
 
eTEXT_WRAPPING_MODE m_wrappingMode { eTEXT_WRAPPING_MODE_NONE }
 The wrapping mode. More...
 
eHALIGN m_hAlign { eHALIGN_LEFT }
 The horizontal alignment. More...
 
eVALIGN m_vAlign { eVALIGN_CENTER }
 The vertical alignment. More...
 
bool m_textChanged { true }
 Tells if the text (caption, wrap mode, or alignments) has changed. More...
 
uint32_t m_tabSize { 4 }
 The size (in spaces) of tabulation character. More...
 
uint32_t m_connection { 0 }
 The connection to the FontTexture changed notification signal. More...
 
eTEXT_TEXTURING_MODE m_texturingMode { eTEXT_TEXTURING_MODE_TEXT }
 The text texture mapping mode. More...
 
TextureCoordsArray m_arrayTextTexture
 The text texture coordinates buffer data. More...
 
- Protected Attributes inherited from Castor3D::OverlayCategory
Overlaym_pOverlay
 The overlay. More...
 
Castor::Point2d m_position
 The relative position (to parent or screen) More...
 
Castor::Point2d m_ptSize
 The relative size (to parent or screen) More...
 
Castor::Position m_pxPosition
 The relative position (to parent or screen), in pixels. More...
 
Castor::Size m_size
 The absolute size in pixels. More...
 
bool m_visible
 The visibility. More...
 
MaterialWPtr m_pMaterial
 The material used by the overlay. More...
 
int m_index
 The overlay index. More...
 
int m_level
 The overlay level. More...
 
Castor::String m_strMatName
 The material name. More...
 
eOVERLAY_TYPE m_type
 The overlay type. More...
 
bool m_sizeChanged
 Tells if this overlay's size has changed. More...
 
bool m_positionChanged
 Tells if this overlay's position has changed. More...
 
Castor::Point4d m_uv
 The UV for the panel. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Castor3D::OverlayCategory
Castor::Point2d DoGetTotalSize () const
 
virtual void DoUpdatePosition ()
 Updates the overlay position, taking care of wanted pixel position. More...
 
virtual void DoUpdateSize ()
 Updates the overlay size, taking care of wanted pixel size. More...
 

Detailed Description

An overlay with a text.

Author
Sylvain DOREMUS
Date
25/08/2010

Constructor & Destructor Documentation

◆ TextOverlay()

C3D_API Castor3D::TextOverlay::TextOverlay ( )

Constructor.

◆ ~TextOverlay()

virtual C3D_API Castor3D::TextOverlay::~TextOverlay ( )
virtual

Destructor.

Member Function Documentation

◆ Create()

static C3D_API OverlayCategorySPtr Castor3D::TextOverlay::Create ( )
static

Creation function, used by the factory.

Returns
An overlay

◆ DECLARE_MAP()

Castor3D::TextOverlay::DECLARE_MAP ( char32_t  ,
Castor::Position  ,
GlyphPosition   
)

◆ DECLARE_VECTOR()

Castor3D::TextOverlay::DECLARE_VECTOR ( Vertex  ,
Vertex   
)

◆ GetCaption()

Castor::String Castor3D::TextOverlay::GetCaption ( ) const
inline

Retrieves the overlay text.

Returns
The value

References m_currentCaption.

◆ GetFontName()

C3D_API Castor::String const& Castor3D::TextOverlay::GetFontName ( ) const
inline

Retrieves the font name.

Returns
The value.

References GetFontTexture().

+ Here is the call graph for this function:

◆ GetFontTexture()

FontTextureSPtr Castor3D::TextOverlay::GetFontTexture ( ) const
inline
Returns
The FontTexture.

References m_fontTexture.

Referenced by GetFontName().

+ Here is the caller graph for this function:

◆ GetHAlign()

eHALIGN Castor3D::TextOverlay::GetHAlign ( ) const
inline

Retrieves the horizontal alignment.

Returns
The value

References m_hAlign.

◆ GetTextVertex()

VertexArray const& Castor3D::TextOverlay::GetTextVertex ( ) const
inline

Retrieves the panel vertex buffer.

Returns
The buffer

References m_arrayVtx.

◆ GetVAlign()

eVALIGN Castor3D::TextOverlay::GetVAlign ( ) const
inline

Retrieves the vertical alignment.

Returns
The value

References m_vAlign.

◆ IsChanged()

virtual C3D_API bool Castor3D::TextOverlay::IsChanged ( ) const
inlinevirtual
Returns
true if this overlay's has changed.

Reimplemented from Castor3D::OverlayCategory.

References m_textChanged.

◆ SetCaption() [1/2]

void Castor3D::TextOverlay::SetCaption ( Castor::String const &  p_caption)
inline

Sets the overlay text.

Parameters
[in]p_captionThe new value

References m_currentCaption, and m_textChanged.

Referenced by SetCaption().

+ Here is the caller graph for this function:

◆ SetCaption() [2/2]

void Castor3D::TextOverlay::SetCaption ( Castor::OutputStream const &  p_caption)
inline

Sets the overlay text.

Parameters
[in]p_captionThe new value

References SetCaption().

+ Here is the call graph for this function:

◆ SetFont()

C3D_API void Castor3D::TextOverlay::SetFont ( Castor::String const &  p_strFont)

Sets the text font.

Parameters
[in]p_strFontThe new value

◆ SetHAlign()

void Castor3D::TextOverlay::SetHAlign ( eHALIGN  p_align)
inline

Defines the horizontal alignment.

Parameters
[in]p_alignThe new value

References m_hAlign, and m_textChanged.

◆ SetTexturingMode()

void Castor3D::TextOverlay::SetTexturingMode ( eTEXT_TEXTURING_MODE  p_mode)
inline

Defines the text texture mapping mode.

Parameters
[in]p_modeThe new value.

References m_textChanged, and m_texturingMode.

◆ SetTextWrappingMode()

void Castor3D::TextOverlay::SetTextWrappingMode ( eTEXT_WRAPPING_MODE  p_mode)
inline

Sets text wrapping mode.

Parameters
[in]p_modeThe new value

References m_textChanged, and m_wrappingMode.

◆ SetVAlign()

void Castor3D::TextOverlay::SetVAlign ( eVALIGN  p_align)
inline

Defines the vertical alignment.

Parameters
[in]p_alignThe new value

References m_textChanged, and m_vAlign.

Member Data Documentation

◆ m_arrayTextTexture

TextureCoordsArray Castor3D::TextOverlay::m_arrayTextTexture
protected

The text texture coordinates buffer data.

◆ m_arrayVtx

VertexArray Castor3D::TextOverlay::m_arrayVtx
protected

The vertex buffer data.

Referenced by GetTextVertex().

◆ m_connection

uint32_t Castor3D::TextOverlay::m_connection { 0 }
protected

The connection to the FontTexture changed notification signal.

◆ m_currentCaption

Castor::String Castor3D::TextOverlay::m_currentCaption
protected

The current overlay caption.

Referenced by GetCaption(), and SetCaption().

◆ m_fontTexture

FontTextureWPtr Castor3D::TextOverlay::m_fontTexture
protected

The texture associated to the overlay font.

Referenced by GetFontTexture().

◆ m_hAlign

eHALIGN Castor3D::TextOverlay::m_hAlign { eHALIGN_LEFT }
protected

The horizontal alignment.

Referenced by GetHAlign(), and SetHAlign().

◆ m_previousCaption

Castor::String Castor3D::TextOverlay::m_previousCaption
protected

The previous overlay caption.

◆ m_tabSize

uint32_t Castor3D::TextOverlay::m_tabSize { 4 }
protected

The size (in spaces) of tabulation character.

◆ m_textChanged

bool Castor3D::TextOverlay::m_textChanged { true }
protected

Tells if the text (caption, wrap mode, or alignments) has changed.

Referenced by IsChanged(), SetCaption(), SetHAlign(), SetTexturingMode(), SetTextWrappingMode(), and SetVAlign().

◆ m_texturingMode

eTEXT_TEXTURING_MODE Castor3D::TextOverlay::m_texturingMode { eTEXT_TEXTURING_MODE_TEXT }
protected

The text texture mapping mode.

Referenced by SetTexturingMode().

◆ m_vAlign

eVALIGN Castor3D::TextOverlay::m_vAlign { eVALIGN_CENTER }
protected

The vertical alignment.

Referenced by GetVAlign(), and SetVAlign().

◆ m_wrappingMode

eTEXT_WRAPPING_MODE Castor3D::TextOverlay::m_wrappingMode { eTEXT_WRAPPING_MODE_NONE }
protected

The wrapping mode.

Referenced by SetTextWrappingMode().


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