Show / Hide Table of Contents

    Class TextUtilities

    Helper class. Contains methods (including extensions) that modify your letters positions and colors.

    Inheritance
    Object
    TextUtilities
    Namespace: Febucci.UI.Core
    Assembly: Febucci.TextAnimator.Runtime.dll
    Syntax
    public static class TextUtilities : object

    Fields

    fakeRandomsCount

    Declaration
    public const int fakeRandomsCount = null
    Field Value
    Type Description
    System.Int32

    verticesPerChar

    Represents the number of vertices per character/letter.

    Declaration
    public const int verticesPerChar = null
    Field Value
    Type Description
    System.Int32
    Remarks

    P.S. bars/underlines have a different vertices number, but are not animated by TextAnimator.

    Properties

    FakeRandoms

    Declaration
    public static Vector3[] FakeRandoms { get; }
    Property Value
    Type Description
    Vector3[]

    Methods

    CalculateCurveDuration(AnimationCurve)

    Calculates the animation curve duration

    Declaration
    public static float CalculateCurveDuration(this AnimationCurve curve)
    Parameters
    Type Name Description
    AnimationCurve curve
    Returns
    Type Description
    System.Single

    GetMiddlePos(Vector3[])

    Returns the middle position of the given array

    Declaration
    public static Vector3 GetMiddlePos(this Vector3[] vec)
    Parameters
    Type Name Description
    Vector3[] vec
    Returns
    Type Description
    Vector3

    LerpUnclamped(Color32[], Color32, Single)

    Lerps all the colors of the characters towards a given target

    Declaration
    public static void LerpUnclamped(this Color32[] col, Color32 target, float pct)
    Parameters
    Type Name Description
    Color32[] col
    Color32 target
    System.Single pct

    LerpUnclamped(Vector3[], Vector3, Single)

    Lerps all the character's vertices (without checking if pct is between 0 and 1)

    Declaration
    public static void LerpUnclamped(this Vector3[] vec, Vector3 target, float pct)
    Parameters
    Type Name Description
    Vector3[] vec
    Vector3 target
    System.Single pct

    MoveChar(Vector3[], Vector3)

    Moves a char towards a direction. Equivalent to adding a vector to all the vertices.

    Declaration
    public static void MoveChar(this Vector3[] vec, Vector3 dir)
    Parameters
    Type Name Description
    Vector3[] vec
    Vector3 dir

    RotateAround(Vector3, Vector2, Single)

    Rotates a point around a 2D center by X degrees

    Declaration
    public static Vector3 RotateAround(this Vector3 vec, Vector2 center, float rotDegrees)
    Parameters
    Type Name Description
    Vector3 vec

    point to rotate

    Vector2 center

    rotation's center

    System.Single rotDegrees

    rotation degrees

    Returns
    Type Description
    Vector3
    Examples

    letterVertex.RotateAround(letterMiddlePoint, angle);

    RotateChar(Vector3[], Single)

    Rotates all the vertices towards an angle, with their center as the rotation pivot

    Declaration
    public static void RotateChar(this Vector3[] vec, float angle)
    Parameters
    Type Name Description
    Vector3[] vec
    System.Single angle

    RotateChar(Vector3[], Single, Vector3)

    Declaration
    public static void RotateChar(this Vector3[] vec, float angle, Vector3 pivot)
    Parameters
    Type Name Description
    Vector3[] vec
    System.Single angle
    Vector3 pivot

    SetChar(Vector3[], Vector3)

    Sets all the vertices of character to the given position.

    Declaration
    public static void SetChar(this Vector3[] vec, Vector3 pos)
    Parameters
    Type Name Description
    Vector3[] vec
    Vector3 pos

    SetColor(Color32[], Color32)

    Sets the color of all the vertices of the character.

    Declaration
    public static void SetColor(this Color32[] col, Color32 target)
    Parameters
    Type Name Description
    Color32[] col
    Color32 target
    In This Article
    • Fields
      • fakeRandomsCount
      • verticesPerChar
    • Properties
      • FakeRandoms
    • Methods
      • CalculateCurveDuration(AnimationCurve)
      • GetMiddlePos(Vector3[])
      • LerpUnclamped(Color32[], Color32, Single)
      • LerpUnclamped(Vector3[], Vector3, Single)
      • MoveChar(Vector3[], Vector3)
      • RotateAround(Vector3, Vector2, Single)
      • RotateChar(Vector3[], Single)
      • RotateChar(Vector3[], Single, Vector3)
      • SetChar(Vector3[], Vector3)
      • SetColor(Color32[], Color32)
    Back to top Text Animator for Unity - Documentation