NAP
Public Attributes | List of all members
RenderableTextComponent Class Reference

#include <renderabletextcomponent.h>

Public Attributes

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...
 
ResourcePtr< RenderLayermLayer
 Property: 'Layer' the render layer assigned to this component. More...
 
std::vector< ResourcePtr< RenderTag > > mTags
 Property: 'Tags' List of tags specifying the category this render component belongs to. 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

- Public Member Functions inherited from Component
virtual void getDependentComponents (std::vector< rtti::TypeInfo > &components) const
 
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
 
- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
 

Description

Draws text into the currently active render target using. Use the Renderable2DTextComponent to render text in screen space and the Renderable3DTextComopnent to render text in 3D space.

The nap::RenderableTextComponentInstance can 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 RenderableTextComponent:
[legend]
Collaboration diagram for RenderableTextComponent:
[legend]

Member Data Documentation

◆ mColor

RGBColorFloat mColor = { 1.0f, 1.0f, 1.0f }

Property: 'TextColor' the color of the text.

◆ mFont

ResourcePtr<Font> mFont

Property: 'Font' that represents the style of the text.

◆ mText

std::string mText

Property: 'Text' to draw.