Class TextRender
Text rendering object.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/UI/TextRender.h
Syntax
public class TextRender : public Actor
Fields
DrawModes
The draw passes to use for rendering this object.
Declaration
public DrawPass DrawModes = DrawPass::Default
Field Value
DrawPass
|
Font
The font asset used as a text characters source.
Declaration
public AssetReference<FontAsset> Font
Field Value
AssetReference<FontAsset>
|
Material
The material used for the text rendering. It must contain texture parameter named Font used to sample font texture.
Declaration
public AssetReference<MaterialBase> Material
Field Value
AssetReference<MaterialBase>
|
ShadowsMode
The shadows casting mode by this visual element.
Declaration
public ShadowsCastingMode ShadowsMode = ShadowsCastingMode::All
Field Value
ShadowsCastingMode
|
SortOrder
The object sort order key used when sorting drawable objects during rendering. Use lower values to draw object before others, higher values are rendered later (on top). Can be used to control transparency drawing.
Declaration
public int8 SortOrder = 0
Field Value
int8
|
Methods
Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)
Deserializes object from the input stream.
Declaration
public virtual void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override
Parameters
DeserializeStream
stream
The input stream. |
ISerializeModifier
modifier
The deserialization modifier object. Always valid. |
Overrides
Draw(RenderContext& renderContext)
Draws this actor. Called by Scene Rendering service. This call is more optimized than generic Draw (eg. geometry is rendered during all pass types but other actors are drawn only during GBufferFill pass).
Declaration
public virtual void Draw(RenderContext& renderContext) override
Parameters
RenderContext
renderContext
The rendering context. |
Overrides
GetCollisionProxy()
Gets the collision proxy used by the text geometry.
Declaration
public CollisionProxy GetCollisionProxy() const
Returns
CollisionProxy
|
GetColor()
GetFontSize()
Gets the font characters size.
Declaration
public float GetFontSize() const
Returns
float
|
GetLayoutOptions()
Gets the layout options. Layout is defined in local space of the object (on XY plane).
Declaration
public TextLayoutOptions GetLayoutOptions() const
Returns
TextLayoutOptions
|
GetLocalBox()
Gets the axis=aligned bounding box of the text vertices in the local-space of the actor.
Declaration
public BoundingBox GetLocalBox() const
Returns
BoundingBox
|
GetText()
HasContentLoaded()
Returns true if actor has loaded content.
Declaration
public virtual bool HasContentLoaded() const override
Returns
bool
|
Overrides
IntersectsItself(const Ray& ray, Real& distance, Vector3& normal)
Determines if there is an intersection between the current object and a ray.
Declaration
public virtual bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override
Parameters
Ray
ray
The ray to test. |
Real
distance
When the method completes, contains the distance of the intersection (if any valid). |
Vector3
normal
When the method completes, contains the intersection surface normal vector (if any valid). |
Returns
bool
True whether the two objects intersected, otherwise false. |
Overrides
OnDebugDrawSelected()
Draws debug shapes for the selected actor and all child scripts.
Declaration
public virtual void OnDebugDrawSelected() override
Overrides
OnDisable()
Called when actor gets removed from game systems. Occurs on EndPlay event or when actor gets inactivated in hierarchy. Use this event to unregister object from other game system (eg. audio).
Declaration
protected virtual void OnDisable() override
Overrides
OnEnable()
Called when actor gets added to game systems. Occurs on BeginPlay event or when actor gets activated in hierarchy. Use this event to register object to other game system (eg. audio).
Declaration
protected virtual void OnEnable() override
Overrides
OnLayerChanged()
Called when layer gets changed.
Declaration
public virtual void OnLayerChanged() override
Overrides
OnTransformChanged()
Called when actor transform gets changed.
Declaration
protected virtual void OnTransformChanged() override
Overrides
Serialize(SerializeStream& stream, const void* otherObj)
Serializes object to the output stream compared to the values of the other object instance (eg. default class object). If other object is null then serialize all properties.
Declaration
public virtual void Serialize(SerializeStream& stream, const void* otherObj) override
Parameters
SerializeStream
stream
The output stream. |
void
otherObj
The instance of the object to compare with and serialize only the modified properties. If null, then serialize all properties. |
Overrides
SetColor(const Color& value)
Sets the color of the text.
Declaration
public void SetColor(const Color& value)
Parameters
Color
value
|
SetFontSize(float value)
Sets the font characters size.
Declaration
public void SetFontSize(float value)
Parameters
float
value
|
SetLayoutOptions(TextLayoutOptions& value)
Sets the layout options. Layout is defined in local space of the object (on XY plane).
Declaration
public void SetLayoutOptions(TextLayoutOptions& value)
Parameters
TextLayoutOptions
value
|
SetText(const LocalizedString& value)
Sets the text.
Declaration
public void SetText(const LocalizedString& value)
Parameters
LocalizedString
value
|
UpdateLayout()
Updates the text vertex buffer layout and cached data if its dirty.
Declaration
public void UpdateLayout()