Search Results for

    Show / Hide Table of Contents

    Class TextContentSizing

    Many core helper methods for auto-sizing Text/UI.Text/TextMeshPro when doing content-sizing calculations using IContentSizeCalculator4x1 for FlexBuilder.

    Contains the crucial method LayoutSizeWithFontSize(Text, CSSContentLengthConstrainable, Nullable<Int32>, Nullable<Int32>, Nullable<Int32>, Boolean, Boolean, Boolean) which is where 99% of the hard work in auto-sizing text happens.

    NB: this was originally private internal implementation, and the APIs in this class are subject to change without notice, but for a few advanced use-cases we had to expose this (e.g. for people doing advanced customization of content-sizing, so that they can re-use the existing complex text calculations instead of having to re-invent the wheel).

    Inheritance
    Object
    TextContentSizing
    Namespace: NinjaTools.FlexBuilder.ContentSizing
    Assembly: cs.temp.dll.dll
    Syntax
    public class TextContentSizing

    Methods

    - (Single) ContentSizeForTextPaddedElement(IContentSizeCalculator4x1, Int32, Text, FlexItem, Axis, CSSAvailableSpace, Boolean, Single, Single, Single, Single, Single, Single)

    Unity reserves a very small amount of padding on several elements - e.g. Button - and doesn't display text outside that area, so this method allows you to specify corrective-padding to workaround this undocumented problem in UnityUI

    Parameters
    IContentSizeCalculator4x1 contentSizeCalculator
    Int32 minSimulatedTextLines
    Text childText
    FlexItem item
    Axis axis
    CSSAvailableSpace sizeToFitInto
    Boolean showDebugMessages
    Single minWidth
    Single minHeight
    Single padLeft
    Single padRight
    Single padTop
    Single padBottom
    Returns
    Single

    - (Int32) FontLineHeight(Text, Int32)

    Parameters
    Text textObject
    Int32 fontSize
    Returns
    Int32

    - (Vector2) LayoutSizeWithFontSize(Text, CSSContentLengthConstrainable, Nullable, Nullable, Nullable, Boolean, Boolean, Boolean)

    Parameters
    Text uiText
    CSSContentLengthConstrainable availableWidth
    Nullable<Int32> maxLines
    Nullable<Int32> maxTotalLineHeight
    Nullable<Int32> maxLongestLineLength
    Boolean allowSoftwrap
    Boolean showDebugMessages
    Boolean suppressUnityBugWarning
    Returns
    Vector2

    - (ContentLength) MinContentSize_PaddedTextElements(Text, FlexItem, Axis, Boolean, Single, Single, Single, Single, Single, Single, Boolean)

    Parameters
    Text text
    FlexItem item
    Axis axis
    Boolean showDebugMessages
    Single minWidth
    Single minHeight
    Single padLeft
    Single padRight
    Single padTop
    Single padBottom
    Boolean suppressUnityBugWarning
    Returns
    ContentLength

    - (String) PlainTextFromRichText(String)

    Parameters
    String richText
    Returns
    String
    In This Article
    Back to top http://flexbuilder.ninja