Struct Text2DRenderer
Enables rendering of 2D text.
Namespace: Unity.Tiny.Text
Syntax
public struct Text2DRenderer : IComponentData
Remarks
The Text module allows you to define Text and Font components on entities, and render them in Canvas or WebGL.
Two types of font are available: Native fonts (from 3 generic fonts widely supported by most browsers) and Bitmap fonts. Add this component to a text entity to specify the style, pivot, and blending.
If you want to set the text inside of a RectTransform component, you must add a RectTransformFinalSize component to the entity with the Text2DRenderer.
If you want to auto-fit the text inside the RectTransform component, you must also add a Text2DAutoFit component.
Fields
blending
{@link BlendOp} for rendering text. The default and regular mode is Alpha.
Declaration
public BlendOp blending
Field Value
Type | Description |
---|---|
BlendOp |
pivot
The center point in the text, relative to the text's bottom-left corner, in unit rectangle coordinates
Declaration
public float2 pivot
Field Value
Type | Description |
---|---|
float2 |
style
The entity on which to look for a Text2DStyle component to use as the Text style.
Declaration
[EntityWithComponents(new Type[]{typeof(Text2DStyle)})]
public Entity style
Field Value
Type | Description |
---|---|
Entity |
Properties
Default
Declaration
public static Text2DRenderer Default { get; }
Property Value
Type | Description |
---|---|
Text2DRenderer |