Public Member Functions | Public Attributes | List of all members
Renderable3DTextComponent Class Reference

#include <renderable3dtextcomponent.h>

Public Member Functions

virtual void getDependentComponents (std::vector< rtti::TypeInfo > &components) const override
- Public Member Functions inherited from Component
virtual const rtti::TypeInfo getInstanceType () const =0
- Public Member Functions inherited from Resource
 Resource ()
- Public Member Functions inherited from Object
 Object ()
virtual ~Object ()
virtual bool init (utility::ErrorState &errorState)
virtual void onDestroy ()
 Object (Object &)=delete
Objectoperator= (const Object &)=delete
 Object (Object &&)=delete
Objectoperator= (Object &&)=delete

Public Attributes

bool mNormalize = true
 Property: 'Normalize' text is rendered at the origin with normalized bounds (-0.5,0.5) More...
EDepthMode mDepthMode = EDepthMode::InheritFromBlendMode
 Property: 'DepthMode' how text is handled by z-buffer. More...
- Public Attributes inherited from RenderableTextComponent
ResourcePtr< FontmFont
 Property: 'Font' that represents the style of the text. More...
std::string mText
 Property: 'Text' to draw. More...
RGBColorFloat mColor = { 1.0f, 1.0f, 1.0f }
 Property: 'TextColor' the color of the text. More...
- Public Attributes inherited from RenderableComponent
bool mVisible = true
 Property: 'Visible' if this object is rendered to target by the render service. More...
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)


Resource part of the Renderable3DTextComponentInstance. Draws flat text in 3D space. Use this component when you want to render text at a specific location in the world Use the normalize toggle to render the text at the origin of the scene with a unit size of 1. When rendering in normalized mode the initial text is used to compute the normalization factor. This ensures that when changing text at runtime the size of the letters don't change as well. Use the Renderable2DTextComponent to draw text in screen (pixel) space with an orthographic camera.

3D text can only be rendered using the render service, similar to how 3D meshes are rendered. The text can be transformed, scaled and rotated. It's best to render 3D text using a perspective camera. The font size directly influences the size of the text unless normalization is turned on. When normalization is turned on the text is rendered centered on the origin with -0.5-0,5 bounds.

It is possible to cache multiple lines at once, where each line can be selected and drawn individually inside a render loop. This is useful when you want the same component to render multiple lines of text, removing the need to declare a component for each individual line. You cannot update or add a line of text when rendering a frame: inside the render loop. Only update or add new lines of text on update. You can however change the position and line of text to draw inside the render loop.

Inheritance diagram for Renderable3DTextComponent:
Collaboration diagram for Renderable3DTextComponent:

Member Function Documentation

◆ getDependentComponents()

virtual void getDependentComponents ( std::vector< rtti::TypeInfo > &  components) const

Get a list of all component types that this component is dependent on (i.e. must be initialized before this one)

componentsthe components this object depends on

Reimplemented from Component.

Member Data Documentation

◆ mDepthMode

Property: 'DepthMode' how text is handled by z-buffer.

◆ mNormalize

bool mNormalize = true

Property: 'Normalize' text is rendered at the origin with normalized bounds (-0.5,0.5)