20 #ifndef ANTKEEPER_SCENE_TEXT_HPP
21 #define ANTKEEPER_SCENE_TEXT_HPP
54 void set_material(std::shared_ptr<render::material> material);
87 [[nodiscard]]
inline const std::shared_ptr<render::material>&
get_material() const noexcept
105 [[nodiscard]]
inline const std::string&
get_content() const noexcept
118 return m_world_bounds;
122 void update_content();
124 void transformed()
override;
127 aabb_type m_local_bounds{{0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}};
128 aabb_type m_world_bounds{{0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}};
131 std::string m_content_u8;
132 std::u32string m_content_u32;
134 std::vector<std::byte> m_vertex_data;
135 std::unique_ptr<gl::vertex_array> m_vertex_array;
136 std::unique_ptr<gl::vertex_buffer> m_vertex_buffer;
geom::box< float > aabb_type
Abstract base class for lights, cameras, model instances, and other scene objects.
void set_content(const std::string &content)
Sets the text content.
void render(render::context &ctx) const override
Adds render operations to a render context.
void set_direction(type::text_direction direction)
Sets the direction of the text.
void set_color(const math::fvec4 &color)
Sets the text color.
const type::text_direction & get_direction() const noexcept
Returns the text direction.
const type::bitmap_font * get_font() const noexcept
Returns the text font.
void refresh()
Manually updates the text object if its font has been updated or altered in any way.
const math::fvec4 & get_color() const noexcept
Returns the text color.
const std::shared_ptr< render::material > & get_material() const noexcept
Returns the text material.
const aabb_type & get_bounds() const noexcept override
Returns the bounds of the object.
void set_material(std::shared_ptr< render::material > material)
Sets the text material.
text()
Constructs a text object.
void set_font(const type::bitmap_font *font)
Sets the text font.
const std::string & get_content() const noexcept
Returns the text content.
Raster font in which glyphs are stored as arrays of pixels.
text_direction
Text writing direction.
@ ltr
Text is written from left to right.
n-dimensional axis-aligned rectangle.
std::shared_ptr< render::material > material