logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class HorizontalLabelLayout

    Restores a horizontal menu option's label after the width measurement clobbered it (the measurement left-anchors and shrinks the label as a side effect). Shared by the runtime layout builder and the editor View Preview so both produce identical horizontal labels.

    Inheritance
    object
    HorizontalLabelLayout
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Menu.Infrastructure.Views.Factories
    Assembly: Serenity.UnityMenu.Infrastructure.dll
    Syntax
    public static class HorizontalLabelLayout
    Remarks

    For simple labeled buttons (SUBMIT/STRING) the label is stretched to fill the button and the text is aligned within it, so LEFT/CENTER/RIGHT all stay inside the button container with no overflow. For composite rows (slider/toggle/selector/…) the real AlignElements(UiComponentInteractionType, UiComponentAlignmentType) pass is used, with RIGHT falling back to CENTER since its button-mirroring overflows a content-sized column.

    Methods

    Apply(UnityUiInteractableComponent, UiComponentAlignmentType, bool)

    Applies the option label layout to component for the given option alignment.

    Declaration
    public static void Apply(UnityUiInteractableComponent component, UiComponentAlignmentType alignment, bool isHorizontal)
    Parameters
    Type Name Description
    UnityUiInteractableComponent component

    The option component to fix up.

    UiComponentAlignmentType alignment

    The menu's option alignment.

    bool isHorizontal

    True for a horizontal menu. Only horizontal composite rows clamp RIGHT→CENTER (its button-mirroring overflows a content-sized column) and disable wrapping; vertical menus keep the real alignment (including RIGHT mirroring) and natural wrapping.

    In this article
    © 2026 Serenity. All Rights Reserved