Struct Text2DRenderer | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    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
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023