MOS
Public Member Functions | Public Attributes | List of all members
mos::gfx::Text Class Referencefinal

Text for rendering. More...

#include <text.hpp>

Public Member Functions

 Text (const std::string &txt, Font font, const glm::mat4 &transform=glm::mat4(1.0f), float spacing=0.0f, float opacity=1.0f, float roughness=1.0f, float metallic=0.0f, const glm::vec3 &emission=glm::vec3(0.0f))
 
auto text (const std::string &text) -> void
 Set text. More...
 
auto text () const -> std::string
 Get text. More...
 
auto width () const -> float
 Approximate width. More...
 
auto height () const -> float
 Approximate height. More...
 
auto position (const glm::vec2 &position) -> void
 Set position.
 
auto position (const glm::vec3 &position) -> void
 Set position.
 
auto position () const -> glm::vec2
 Get position. More...
 
auto scale (float scale) -> void
 Set scale. More...
 
auto transform (const glm::mat4 &transform) -> void
 Set transform.
 
auto transform () const -> glm::mat4
 Get transform.
 
auto model () const -> Model
 Get model. More...
 
auto opacity (float opacity) -> void
 Set opacity. More...
 
auto emission (const glm::vec3 &emission) -> void
 Set if the text is emissive. More...
 
auto font () const -> Font
 Get the font. More...
 
auto operator= (const std::string &input) -> Text &
 
auto operator+= (const std::string &input) -> Text &
 

Public Attributes

float spacing
 

Detailed Description

Text for rendering.

Member Function Documentation

◆ emission()

auto mos::gfx::Text::emission ( const glm::vec3 &  emission) -> void

Set if the text is emissive.

◆ font()

auto mos::gfx::Text::font ( ) const -> Font

Get the font.

◆ height()

auto mos::gfx::Text::height ( ) const -> float

Approximate height.

◆ model()

auto mos::gfx::Text::model ( ) const -> Model

Get model.

◆ opacity()

auto mos::gfx::Text::opacity ( float  opacity) -> void

Set opacity.

◆ position()

auto mos::gfx::Text::position ( ) const -> glm::vec2

Get position.

◆ scale()

auto mos::gfx::Text::scale ( float  scale) -> void

Set scale.

◆ text() [1/2]

auto mos::gfx::Text::text ( const std::string &  text) -> void

Set text.

◆ text() [2/2]

auto mos::gfx::Text::text ( ) const -> std::string

Get text.

◆ width()

auto mos::gfx::Text::width ( ) const -> float

Approximate width.


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