Castor3D 0.17.0
Multiplatform 3D engine
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
castor3d::TextOverlay Class Reference

#include <TextOverlay.hpp>

Inheritance diagram for castor3d::TextOverlay:
Inheritance graph
[legend]
Collaboration diagram for castor3d::TextOverlay:
Collaboration graph
[legend]

Classes

struct  Vertex
 Holds specific vertex data for a TextOverlay. More...
 

Public Types

enum class  ComputeBindingIdx {
  eCamera , eOverlays , eChars , eWords ,
  eLines , eFont , eVertex
}
 

Public Member Functions

 CU_DeclareVector (Vertex, Vertex)
 
 CU_DeclareMap (char32_t, castor::Position, GlyphPosition)
 
C3D_API TextOverlay ()
 Constructor.
 
C3D_API void accept (OverlayVisitor &visitor) const override
 Draws the overlay.
 
C3D_API uint32_t getCount (bool) const
 
C3D_API float fillBuffer (uint32_t overlayIndex, castor::ArrayView< TextChar > texts, castor::ArrayView< TextWord > words, castor::ArrayView< TextLine > lines) const noexcept
 Fills the text buffers.
 
C3D_API void setFont (castor::String const &value)
 Sets the text font.
 

Getters.

bool isChanged () const noexcept override
 
castor::String const & getFontName () const
 
FontTextureRPtr getFontTexture () const
 
castor::U32String getCaption () const
 
TextWrappingMode getTextWrappingMode () const
 
HAlign getHAlign () const
 
VAlign getVAlign () const
 
TextTexturingMode getTexturingMode () const
 
TextLineSpacingMode getLineSpacingMode () const
 
uint32_t getCharCount () const noexcept
 
uint32_t getWordCount () const noexcept
 
uint32_t getLineCount () const noexcept
 
uint32_t getSDFHeight () const noexcept
 

Mutators.

void setCaption (castor::U32String value) noexcept
 
void setTextWrappingMode (TextWrappingMode value) noexcept
 
void setHAlign (HAlign value) noexcept
 
void setVAlign (VAlign value) noexcept
 
void setTexturingMode (TextTexturingMode value) noexcept
 
void setLineSpacingMode (TextLineSpacingMode value) noexcept
 
void setSDFHeight (uint32_t value) noexcept
 
- Public Member Functions inherited from castor3d::OverlayCategory
 CU_DeclareVector (Vertex, Vertex)
 
C3D_API OverlayCategory (OverlayType type)
 Constructor.
 
virtual C3D_API ~OverlayCategory () noexcept=default
 Destructor.
 
C3D_API void update (OverlayRenderer const &renderer)
 Updates the overlay position, size...
 
C3D_API void reset ()
 Marks this cetegory as clean.
 
virtual C3D_API void setMaterial (MaterialObs material)
 Sets the material.
 
C3D_API castor::String const & getOverlayName () const
 Retrieves the overlay name.
 
C3D_API castor::Position getAbsolutePosition (castor::Size const &size) const
 Retrieves the absolute overlay position, in pixels.
 
C3D_API castor::Size getAbsoluteSize (castor::Size const &size) const
 Retrieves the absolute overlay size, in pixels.
 
C3D_API castor::Point2d getRenderRatio (castor::Size const &size) const
 
C3D_API castor::Point2d getAbsolutePosition () const
 Retrieves the absolute overlay position.
 
C3D_API castor::Point2d getAbsoluteSize () const
 Retrieves the absolute overlay size.
 
C3D_API bool isSizeChanged () const
 
C3D_API bool isPositionChanged () const
 
C3D_API castor::Size computePixelSize () const
 Retrieves the overlay size.
 
C3D_API castor::Position computePixelPosition () const
 Retrieves the overlay position.
 
C3D_API castor::Point4d computeScissorRect () const
 Updates the scissor for this overlay.
 
bool hasAnyChange () const noexcept
 
castor::Point4d const & getDisplayRect () const noexcept
 
castor::Point2d const & getRelativeSize () const noexcept
 
castor::Point2d const & getRelativePosition () const noexcept
 
OverlayType getType () const noexcept
 
bool isVisible () const noexcept
 
bool isDisplayable () const noexcept
 
MaterialObs getMaterial () const noexcept
 
uint32_t getIndex () const noexcept
 
uint32_t getLevel () const noexcept
 
Overlay const & getOverlay () const noexcept
 
OverlaygetOverlay () noexcept
 
castor::Point4d const & getUV () const noexcept
 
bool hasPixelPosition () const noexcept
 
bool hasPixelSize () const noexcept
 
castor::Position const & getPixelPosition () const noexcept
 
castor::Size const & getPixelSize () const noexcept
 
void setRelativePosition (castor::Point2d const &value) noexcept
 
void setRelativeSize (castor::Point2d const &value) noexcept
 
void setPixelPosition (castor::Position const &value) noexcept
 
void setPixelSize (castor::Size const &value) noexcept
 
void setOverlay (Overlay *value) noexcept
 
void setVisible (bool value) noexcept
 
void setOrder (uint32_t level, uint32_t index) noexcept
 
void setUV (castor::Point4d const &value) noexcept
 

Static Public Member Functions

static C3D_API OverlayCategoryUPtr create ()
 Creation function, used by the factory.
 
static C3D_API ashes::PipelineShaderStageCreateInfo createProgram (RenderDevice const &device)
 Creates the shader program used to compute the overlay's vertices.
 

Additional Inherited Members

- Protected Member Functions inherited from castor3d::OverlayCategory
C3D_API void updatePosition (OverlayRenderer const &renderer)
 Updates the overlay position, taking care of wanted pixel position.
 
C3D_API void updateSize (OverlayRenderer const &renderer)
 Updates the overlay size, taking care of wanted pixel size.
 
C3D_API void updateClientArea ()
 Updates the overlay size, taking care of wanted pixel size.
 
C3D_API castor::Point2d getParentSize () const
 
C3D_API bool isFullyCropped () const
 
- Protected Attributes inherited from castor3d::OverlayCategory
Overlaym_overlay { nullptr }
 
castor::Point2d m_relPosition
 
castor::Point2d m_relSize
 
std::optional< castor::Positionm_pxPosition
 
std::optional< castor::Sizem_pxSize
 
castor::Size m_computeSize
 
bool m_visible { true }
 
bool m_displayable { false }
 
MaterialObs m_material {}
 
uint32_t m_index { 0 }
 
uint32_t m_level { 0 }
 
OverlayType m_type
 
bool m_sizeChanged { true }
 
bool m_positionChanged { true }
 
castor::Point4d m_uv { 0.0, 0.0, 1.0, 1.0 }
 
castor::Point4d m_displayRect {}
 

Member Enumeration Documentation

◆ ComputeBindingIdx

Enumerator
eCamera 
eOverlays 
eChars 
eWords 
eLines 
eFont 
eVertex 

Constructor & Destructor Documentation

◆ TextOverlay()

C3D_API castor3d::TextOverlay::TextOverlay ( )

Constructor.

Member Function Documentation

◆ accept()

C3D_API void castor3d::TextOverlay::accept ( OverlayVisitor & visitor) const
overridevirtual

Draws the overlay.

Implements castor3d::OverlayCategory.

◆ create()

static C3D_API OverlayCategoryUPtr castor3d::TextOverlay::create ( )
static

Creation function, used by the factory.

Returns
An overlay

◆ createProgram()

static C3D_API ashes::PipelineShaderStageCreateInfo castor3d::TextOverlay::createProgram ( RenderDevice const & device)
static

Creates the shader program used to compute the overlay's vertices.

Returns
The program.

◆ CU_DeclareMap()

castor3d::TextOverlay::CU_DeclareMap ( char32_t ,
castor::Position ,
GlyphPosition  )

◆ CU_DeclareVector()

castor3d::TextOverlay::CU_DeclareVector ( Vertex ,
Vertex  )

◆ fillBuffer()

C3D_API float castor3d::TextOverlay::fillBuffer ( uint32_t overlayIndex,
castor::ArrayView< TextChar > texts,
castor::ArrayView< TextWord > words,
castor::ArrayView< TextLine > lines ) const
noexcept

Fills the text buffers.

Parameters
[out]overlayIndexThe overlay index.
[out]textsView on the allocated text chars for the overlay.
[out]wordsView on the allocated text words for the overlay.
[out]linesView on the allocated text lines for the overlay.

◆ getCaption()

castor::U32String castor3d::TextOverlay::getCaption ( ) const
inline

◆ getCharCount()

uint32_t castor3d::TextOverlay::getCharCount ( ) const
inlinenoexcept

◆ getCount()

C3D_API uint32_t castor3d::TextOverlay::getCount ( bool ) const
Returns
The vertex count needed for this overlay.

◆ getFontName()

castor::String const & castor3d::TextOverlay::getFontName ( ) const
inline

References getFontTexture().

Here is the call graph for this function:

◆ getFontTexture()

FontTextureRPtr castor3d::TextOverlay::getFontTexture ( ) const
inline

Referenced by getFontName().

Here is the caller graph for this function:

◆ getHAlign()

HAlign castor3d::TextOverlay::getHAlign ( ) const
inline

◆ getLineCount()

uint32_t castor3d::TextOverlay::getLineCount ( ) const
inlinenoexcept

◆ getLineSpacingMode()

TextLineSpacingMode castor3d::TextOverlay::getLineSpacingMode ( ) const
inline

◆ getSDFHeight()

uint32_t castor3d::TextOverlay::getSDFHeight ( ) const
inlinenoexcept

◆ getTexturingMode()

TextTexturingMode castor3d::TextOverlay::getTexturingMode ( ) const
inline

◆ getTextWrappingMode()

TextWrappingMode castor3d::TextOverlay::getTextWrappingMode ( ) const
inline

◆ getVAlign()

VAlign castor3d::TextOverlay::getVAlign ( ) const
inline

◆ getWordCount()

uint32_t castor3d::TextOverlay::getWordCount ( ) const
inlinenoexcept

◆ isChanged()

bool castor3d::TextOverlay::isChanged ( ) const
inlineoverridevirtualnoexcept

Reimplemented from castor3d::OverlayCategory.

◆ setCaption()

void castor3d::TextOverlay::setCaption ( castor::U32String value)
inlinenoexcept

◆ setFont()

C3D_API void castor3d::TextOverlay::setFont ( castor::String const & value)

Sets the text font.

Parameters
[in]valueThe new value

◆ setHAlign()

void castor3d::TextOverlay::setHAlign ( HAlign value)
inlinenoexcept

◆ setLineSpacingMode()

void castor3d::TextOverlay::setLineSpacingMode ( TextLineSpacingMode value)
inlinenoexcept

◆ setSDFHeight()

void castor3d::TextOverlay::setSDFHeight ( uint32_t value)
inlinenoexcept

◆ setTexturingMode()

void castor3d::TextOverlay::setTexturingMode ( TextTexturingMode value)
inlinenoexcept

◆ setTextWrappingMode()

void castor3d::TextOverlay::setTextWrappingMode ( TextWrappingMode value)
inlinenoexcept

◆ setVAlign()

void castor3d::TextOverlay::setVAlign ( VAlign value)
inlinenoexcept

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