Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Text2DAutoFit

When added to an entity with a Text2DRenderer component, auto-fits the text within a RectTransform.

For Text2DAutofit to work, you must also: add a RectTransformFinalSize component to the entity, and schedule the SetRectTransformSizeSystem in the UILayout module.

The RectTransformFinalSize component enables the SetRectTransformSizeSystem to get the correct auto-fit size at runtime.

Hierarchy

Index

Constructors

constructor

  • new Text2DAutoFit(minSize?: number, maxSize?: number): Text2DAutoFit
  • Parameters

    • Optional minSize: number
    • Optional maxSize: number

    Returns Text2DAutoFit

Properties

maxSize

maxSize: number

The maximum font size.

minSize

minSize: number

The minimum font size. If the font size computed at runtime to fit in the RectTransform is below this value, the text does not render.

Static _isSharedComp

_isSharedComp: boolean

Static _size

_size: number

Static _view

_view: any

Static cid

cid: number

Static maxSize

Static minSize

Methods

Static _dtorFn

  • Parameters

    Returns void

Static _fromPtr

Static _tempHeapPtr

  • Parameters

    Returns number

Static _toPtr

  • Parameters

    Returns void

Generated using TypeDoc