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.
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
Fields
Mode
Where the background comes from.
Declaration
public readonly LeaderboardBackgroundMode Mode
Field Value
PixelsPerUnitMultiplier
Declaration
public readonly float PixelsPerUnitMultiplier
Field Value
Slicing
How the sprite is sliced. Only applied when Mode is CUSTOM.
Declaration
public readonly LeaderboardBackgroundSlicing Slicing
Field Value
SpriteOverride
The author's replacement sprite. Only applied when Mode is CUSTOM.
Declaration
public readonly Sprite SpriteOverride
Field Value
Tint
Tint applied to the background image, in every visible mode.
Declaration
public readonly Color Tint
Field Value
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
OverridesImageType
Whether this style changes the target's UnityEngine.UI.Image.type.
Declaration
public bool OverridesImageType { get; }
Property Value
OverridesSprite
Whether this style replaces the target's sprite.
Declaration
public bool OverridesSprite { get; }
Property Value
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
Visible
Whether the background renders at all.
Declaration
public bool Visible { get; }
Property Value
Methods
ResolvePixelsPerUnitMultiplier()
The multiplier defended against zero/negative input: UGUI divides by it, so it must stay strictly positive.
Declaration
public float ResolvePixelsPerUnitMultiplier()
Returns
ToImageType()
Maps Slicing onto the UnityEngine.UI.Image.Type it renders as.
Declaration
public Image.Type ToImageType()
Returns