logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Struct LeaderboardBackgroundStyle

    A resolved, ready-to-apply description of how a leaderboard view's background renders: mode, sprite override, tint, slicing and pixels-per-unit multiplier. Mirrors UnityLeaderboardViewDefinition.ResolveValueSpec()/ ResolveColumnLayout(): the raw authored fields resolve once into this single shape, so ConfigureBackground(LeaderboardBackgroundStyle) never has to re-derive what a mode/slicing combination means. Ported from the Theme Builder's own sprite-slot resolution (ThemeSpriteSlot), which this style mirrors field-for-field for the modes it shares.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Serenity.Leaderboard.Infrastructure.Views
    Assembly: Serenity.UnityLeaderboard.Infrastructure.dll
    Syntax
    public readonly struct LeaderboardBackgroundStyle

    Constructors

    LeaderboardBackgroundStyle(LeaderboardBackgroundMode, Sprite, Color, LeaderboardBackgroundSlicing, float)

    Declaration
    public LeaderboardBackgroundStyle(LeaderboardBackgroundMode mode, Sprite spriteOverride, Color tint, LeaderboardBackgroundSlicing slicing, float pixelsPerUnitMultiplier)
    Parameters
    Type Name Description
    LeaderboardBackgroundMode mode
    Sprite spriteOverride
    Color tint
    LeaderboardBackgroundSlicing slicing
    float pixelsPerUnitMultiplier

    Fields

    Mode

    Where the background comes from.

    Declaration
    public readonly LeaderboardBackgroundMode Mode
    Field Value
    Type Description
    LeaderboardBackgroundMode

    PixelsPerUnitMultiplier

    The authored pixels-per-unit multiplier, before ResolvePixelsPerUnitMultiplier() clamps it.

    Declaration
    public readonly float PixelsPerUnitMultiplier
    Field Value
    Type Description
    float

    Slicing

    How the sprite is sliced. Only applied when Mode is CUSTOM.

    Declaration
    public readonly LeaderboardBackgroundSlicing Slicing
    Field Value
    Type Description
    LeaderboardBackgroundSlicing

    SpriteOverride

    The author's replacement sprite. Only applied when Mode is CUSTOM.

    Declaration
    public readonly Sprite SpriteOverride
    Field Value
    Type Description
    Sprite

    Tint

    Tint applied to the background image, in every visible mode.

    Declaration
    public readonly Color Tint
    Field Value
    Type Description
    Color

    Properties

    Default

    The style a null definition (or a freshly authored one) resolves to: THEME, white tint, no sprite override.

    Declaration
    public static LeaderboardBackgroundStyle Default { get; }
    Property Value
    Type Description
    LeaderboardBackgroundStyle

    OverridesImageType

    Whether this style changes the target's UnityEngine.UI.Image.type.

    Declaration
    public bool OverridesImageType { get; }
    Property Value
    Type Description
    bool

    OverridesSprite

    Whether this style replaces the target's sprite.

    Declaration
    public bool OverridesSprite { get; }
    Property Value
    Type Description
    bool

    UsesPixelsPerUnitMultiplier

    True for the modes where UnityEngine.UI.Image.pixelsPerUnitMultiplier changes the rendered result — Sliced and Tiled scale their border caps by it; Simple ignores it.

    Declaration
    public bool UsesPixelsPerUnitMultiplier { get; }
    Property Value
    Type Description
    bool

    Visible

    Whether the background renders at all.

    Declaration
    public bool Visible { get; }
    Property Value
    Type Description
    bool

    Methods

    ResolvePixelsPerUnitMultiplier()

    The multiplier defended against zero/negative input: UGUI divides by it, so it must stay strictly positive.

    Declaration
    public float ResolvePixelsPerUnitMultiplier()
    Returns
    Type Description
    float

    ToImageType()

    Maps Slicing onto the UnityEngine.UI.Image.Type it renders as.

    Declaration
    public Image.Type ToImageType()
    Returns
    Type Description
    Type
    In this article
    © 2026 Serenity. All Rights Reserved