docs.unity3d.com

Localization 1.5.1

Search Results for

    Show / Hide Table of Contents

    Class Expander

    Expands the size of the input string to show where there may not be enough space for languages that result in longer strings, and either wrap awkwardly or truncate.

    Inheritance
    object
    Expander
    Implements
    IPseudoLocalizationMethod
    Namespace: UnityEngine.Localization.Pseudo
    Assembly: Unity.Localization.dll
    Syntax
    [Serializable]
    public class Expander : IPseudoLocalizationMethod

    Constructors

    Name Description
    Expander()

    Creates an instance with default padding characters.

    Expander(char)

    Creates an instance with a single padding character.

    Expander(char, char)

    Creates an instance with a range of padding characters from start to end.

    Properties

    Name Description
    ExpansionRules

    Rules based on string length, that determine the amount to append onto the input string as a ratio of its length. For example, 0.3 would add an extra 30% onto the length. Note: Negative values are ignored. When the newly calculated length is not whole then the next largest whole number will be used. Rules can also be added using SetConstantExpansion(float) and AddExpansionRule(int, int, float).

    Location

    The location where the padding characters will be added to the input string.

    MinimumStringLength

    The minimum length strings should be before evaluating the ExpansionRules. For example if the value was 10, then all strings under 10 in length would be increased to 10 before the expansion rules were applied. By default this value is 1.

    PaddingCharacters

    The characters to randomly pick from when padding the length.

    Methods

    Name Description
    AddCharacterRange(char, char)

    Adds all characters between start and end to the list of padding characters.

    AddExpansionRule(int, int, float)

    Adds an expansion rule to ExpansionRules

    SetConstantExpansion(float)

    Sets a single expansion rule that will be applied to all strings.

    Transform(Message)

    Pad the string with random characters to increase its length.

    In This Article
    • Constructors
    • Properties
    • Methods
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)