Antkeeper  0.0.1
Public Member Functions | List of all members
scene::text Class Reference

Text scene object. More...

#include <text.hpp>

Inheritance diagram for scene::text:
scene::object< text > scene::object_base

Public Member Functions

 text ()
 Constructs a text object. More...
 
void render (render::context &ctx) const override
 Adds render operations to a render context. More...
 
void refresh ()
 Manually updates the text object if its font has been updated or altered in any way. More...
 
void set_material (std::shared_ptr< render::material > material)
 Sets the text material. More...
 
void set_font (const type::bitmap_font *font)
 Sets the text font. More...
 
void set_direction (type::text_direction direction)
 Sets the direction of the text. More...
 
void set_content (const std::string &content)
 Sets the text content. More...
 
void set_color (const math::fvec4 &color)
 Sets the text color. More...
 
const std::shared_ptr< render::material > & get_material () const noexcept
 Returns the text material. More...
 
const type::bitmap_fontget_font () const noexcept
 Returns the text font. More...
 
const type::text_directionget_direction () const noexcept
 Returns the text direction. More...
 
const std::string & get_content () const noexcept
 Returns the text content. More...
 
const math::fvec4get_color () const noexcept
 Returns the text color. More...
 
const aabb_typeget_bounds () const noexcept override
 Returns the bounds of the object. More...
 
- Public Member Functions inherited from scene::object< text >
const std::size_t get_object_type_id () const noexcept final
 Returns the type ID for this scene object type. More...
 
- Public Member Functions inherited from scene::object_base
void look_at (const vector_type &position, const vector_type &target, const vector_type &up)
 
constexpr void set_layer_mask (std::uint32_t mask) noexcept
 Sets the layer mask of the object. More...
 
void set_transform (const transform_type &transform)
 Sets the transform of the object. More...
 
void set_translation (const vector_type &translation)
 Sets the translation of the object. More...
 
void set_rotation (const quaternion_type &rotation)
 Sets the rotation of the object. More...
 
constexpr std::uint32_t get_layer_mask () const noexcept
 Returns the layer mask of the object. More...
 
constexpr const transform_typeget_transform () const noexcept
 Returns the transform of the object. More...
 
constexpr const vector_typeget_translation () const noexcept
 Returns the translation of the object. More...
 
constexpr const quaternion_typeget_rotation () const noexcept
 Returns the rotation of the object. More...
 
constexpr const vector_typeget_scale () const noexcept
 Returns the scale of the object. More...
 
void set_scale (const vector_type &scale)
 Sets the scale of the object. More...
 
void set_scale (float scale)
 Sets the scale of the object. More...
 

Additional Inherited Members

- Public Types inherited from scene::object_base
using vector_type = math::fvec3
 
using quaternion_type = math::fquat
 
using transform_type = math::transform< float >
 
using aabb_type = geom::box< float >
 
- Static Public Attributes inherited from scene::object< text >
static const std::atomic< std::size_t > object_type_id
 Unique type ID for this scene object type. More...
 
- Static Protected Member Functions inherited from scene::object_base
static std::size_t next_object_type_id ()
 
- Protected Attributes inherited from scene::object_base
std::uint32_t m_layer_mask {1}
 
transform_type m_transform {transform_type::identity()}
 

Detailed Description

Text scene object.

Definition at line 36 of file text.hpp.

Constructor & Destructor Documentation

◆ text()

scene::text::text ( )

Constructs a text object.

Definition at line 58 of file text.cpp.

Member Function Documentation

◆ get_bounds()

const aabb_type& scene::text::get_bounds ( ) const
inlineoverridevirtualnoexcept

Returns the bounds of the object.

Implements scene::object_base.

Definition at line 116 of file text.hpp.

◆ get_color()

const math::fvec4& scene::text::get_color ( ) const
inlinenoexcept

Returns the text color.

Definition at line 111 of file text.hpp.

◆ get_content()

const std::string& scene::text::get_content ( ) const
inlinenoexcept

Returns the text content.

Definition at line 105 of file text.hpp.

◆ get_direction()

const type::text_direction& scene::text::get_direction ( ) const
inlinenoexcept

Returns the text direction.

Definition at line 99 of file text.hpp.

◆ get_font()

const type::bitmap_font* scene::text::get_font ( ) const
inlinenoexcept

Returns the text font.

Definition at line 93 of file text.hpp.

◆ get_material()

const std::shared_ptr<render::material>& scene::text::get_material ( ) const
inlinenoexcept

Returns the text material.

Definition at line 87 of file text.hpp.

◆ refresh()

void scene::text::refresh ( )

Manually updates the text object if its font has been updated or altered in any way.

Definition at line 88 of file text.cpp.

◆ render()

void scene::text::render ( render::context ctx) const
overridevirtual

Adds render operations to a render context.

Parameters
ctxRender context.

Reimplemented from scene::object_base.

Definition at line 78 of file text.cpp.

◆ set_color()

void scene::text::set_color ( const math::fvec4 color)

Sets the text color.

Text color is passed to the text's material shader as a vertex color.

Parameters
colorRGBA color.

Definition at line 126 of file text.cpp.

◆ set_content()

void scene::text::set_content ( const std::string &  content)

Sets the text content.

Parameters
contentUTF-8 string of text.

Definition at line 116 of file text.cpp.

◆ set_direction()

void scene::text::set_direction ( type::text_direction  direction)

Sets the direction of the text.

Parameters
directionText direction.

Definition at line 107 of file text.cpp.

◆ set_font()

void scene::text::set_font ( const type::bitmap_font font)

Sets the text font.

Parameters
fontPointer to a font.

Definition at line 98 of file text.cpp.

◆ set_material()

void scene::text::set_material ( std::shared_ptr< render::material material)

Sets the text material.

Parameters
materialText material.

Definition at line 93 of file text.cpp.


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