LabelSettings
Shared Label styling: font, spacing, outlines and shadows.
Assign LabelSettings to Label.LabelSettings to share styling across labels. Corresponding resource values override Label theme values. Font = null permits theme-font fallback, while other resource settings, including FontSize, still apply.
Defaults: FontSize = 16, white FontColor, LineSpacing = 3, ParagraphSpacing = 0 and OutlineSize = 0. ShadowColor is transparent, so the base shadow is invisible despite ShadowSize = 1 and ShadowOffset = (1, 1). ShadowSize expands the shadow outline rather than applying Gaussian blur.
The resource is shared: changing FontSize or color affects every Label using it. Changed-value setters emit Changed; repeating the same value normally does not. Changes from nested Font are forwarded through LabelSettings. For individual styling, duplicate LabelSettings and assign the copy to that label. Ordinary Duplicate separates style values and layer lists but retains shared Font — mutating the font itself can affect both copies.
LineSpacing adds space between lines; ParagraphSpacing adds space between paragraphs. Both use pixels and accept fractions; neither sets text width or enables wrapping. Use positive font sizes and nonnegative outline widths; size setters do not replace validation of external data.
Additional effects use indices. First AddStackedOutline/Shadow or set Count, then configure existing layers’ size, color and offset. A new outline has Size = 0 and black color; a new shadow has Offset = (1, 1), opaque black color and OutlineSize = 0. Set its color explicitly unless black is intended. Growing Count adds defaults; shrinking discards tail layers.
Add with index = -1 appends; nonnegative indices 0…Count insert before that position. Move takes an insertion position before removal of the source, also 0…Count. For three layers, MoveStackedOutline(0, 3) moves the first to the end, while (0, 1) retains order. Even such an unchanged-order move emits Changed. Insertion/removal shifts subsequent indices.
Additional outline widths accumulate with base OutlineSize: each is added thickness rather than an independent absolute radius. Outer layers draw before inner ones. Stacked shadows draw from the last index to the first, before outlines and main text. Large cumulative outlines require adequate font MSDF range settings or edges can be clipped.
Effects do not reserve parent-layout space. Large outlines or ShadowOffset can extend beyond the Label and be clipped by a parent. Allocate padding through a container and consider clipping separately; changing color does not supply missing space.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
LabelSettingsConstructor
public LabelSettings();Creates a resource: Font = null, FontSize = 16, white FontColor, LineSpacing = 3, ParagraphSpacing = 0, OutlineSize = 0, transparent base shadow; both extra-effect lists empty.
Properties12
FontProperty
public Font Font { get; set; }Shared Font reference, or null for Label theme font. Assigned Font changes are forwarded through Changed; replacement disconnects the old resource. Default LabelSettings duplication does not make Font independent.
FontColorProperty
public Color FontColor { get; set; }Main text color/alpha, default white. Editing a shared resource affects every Label using it. Does not set shadow/outline colors.
FontSizeProperty
public int FontSize { get; set; }Font size in pixels, default 16. Overrides theme font_size while LabelSettings is assigned. Supply a positive number; setter does not automatically constrain it.
LineSpacingProperty
public float LineSpacing { get; set; }Additional line gap in pixels, default 3; fractions accepted. Not paragraph spacing, font size or wrapping width.
OutlineColorProperty
public Color OutlineColor { get; set; }Base outline color, default white. Visibility requires positive OutlineSize and nontransparent color. Does not change extra-layer colors.
OutlineSizeProperty
public int OutlineSize { get; set; }Base outline thickness in pixels, default 0. Nonnegative stacked thicknesses add to it. Does not reserve layout space.
ParagraphSpacingProperty
public float ParagraphSpacing { get; set; }Additional paragraph gap in pixels, default 0; fractions accepted. Configure the paragraph delimiter separately on Label.
ShadowColorProperty
public Color ShadowColor { get; set; }Base shadow color, default transparent black. Alpha 0 hides this shadow without disabling separate stacked shadows.
ShadowOffsetProperty
public Vector2 ShadowOffset { get; set; }Base shadow offset in local pixels, default (1, 1). Does not add Label minimum-size padding; parent clipping can cut the effect.
ShadowSizeProperty
public int ShadowSize { get; set; }Base shadow outline thickness in pixels, default 1. Not a blur radius. Transparent ShadowColor hides the base shadow.
StackedOutlineCountProperty
public int StackedOutlineCount { get; set; }Nonnegative extra-outline count. Growth adds Size = 0/black layers; shrinking removes the tail. Separate from the base OutlineSize outline.
StackedShadowCountProperty
public int StackedShadowCount { get; set; }Nonnegative extra-shadow count. New layers have Offset = (1, 1), opaque black color and OutlineSize = 0. Shrinking discards tail layers.
Methods40
AddStackedOutlinevoid
public void AddStackedOutline(int index = -1);Inserts an outline at position 0…Count; default -1 appends. New thickness 0 and black color. Increases Count, shifts indices and emits Changed.
| Name | Type | Default |
|---|---|---|
index | int | -1 |
indexInsertion position 0…Count; -1 appends.
AddStackedShadowvoid
public void AddStackedShadow(int index = -1);Inserts a shadow at position 0…Count; default -1 appends. New layer is opaque black with offset (1, 1) and outline 0; configure it explicitly.
| Name | Type | Default |
|---|---|---|
index | int | -1 |
indexInsertion position 0…Count; -1 appends.
GetFontFont
public Font GetFont();Shared Font reference, or null for Label theme font. Assigned Font changes are forwarded through Changed; replacement disconnects the old resource. Default LabelSettings duplication does not make Font independent.
FontStored shared Font reference or null.
GetFontColorColor
public Color GetFontColor();Main text color/alpha, default white. Editing a shared resource affects every Label using it. Does not set shadow/outline colors.
ColorStored main text color.
GetFontSizeint
public int GetFontSize();Font size in pixels, default 16. Overrides theme font_size while LabelSettings is assigned. Supply a positive number; setter does not automatically constrain it.
intStored font size in pixels.
GetLineSpacingfloat
public float GetLineSpacing();Additional line gap in pixels, default 3; fractions accepted. Not paragraph spacing, font size or wrapping width.
floatStored additional line gap in pixels.
GetOutlineColorColor
public Color GetOutlineColor();Base outline color, default white. Visibility requires positive OutlineSize and nontransparent color. Does not change extra-layer colors.
ColorStored base outline color.
GetOutlineSizeint
public int GetOutlineSize();Base outline thickness in pixels, default 0. Nonnegative stacked thicknesses add to it. Does not reserve layout space.
intStored base outline thickness in pixels.
GetParagraphSpacingfloat
public float GetParagraphSpacing();Additional paragraph gap in pixels, default 0; fractions accepted. Configure the paragraph delimiter separately on Label.
floatStored additional paragraph gap in pixels.
GetShadowColorColor
public Color GetShadowColor();Base shadow color, default transparent black. Alpha 0 hides this shadow without disabling separate stacked shadows.
ColorStored base shadow color.
GetShadowOffsetVector2
public Vector2 GetShadowOffset();Base shadow offset in local pixels, default (1, 1). Does not add Label minimum-size padding; parent clipping can cut the effect.
Vector2Stored base shadow offset in pixels.
GetShadowSizeint
public int GetShadowSize();Base shadow outline thickness in pixels, default 1. Not a blur radius. Transparent ShadowColor hides the base shadow.
intStored base shadow outline thickness in pixels.
GetStackedOutlineColorColor
public Color GetStackedOutlineColor(int index);Returns selected extra-outline color, black for a new layer.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexExisting zero-based layer index below the corresponding Count.
ColorReturns selected extra-outline color, black for a new layer.
GetStackedOutlineCountint
public int GetStackedOutlineCount();Nonnegative extra-outline count. Growth adds Size = 0/black layers; shrinking removes the tail. Separate from the base OutlineSize outline.
intStored extra-outline count.
GetStackedOutlineSizeint
public int GetStackedOutlineSize(int index);Returns stored added layer thickness rather than total outline radius. Index must exist.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexExisting zero-based layer index below the corresponding Count.
intReturns stored added layer thickness rather than total outline radius. Index must exist.
GetStackedShadowColorColor
public Color GetStackedShadowColor(int index);Returns stored extra-shadow color; a new layer is opaque black.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexExisting zero-based layer index below the corresponding Count.
ColorReturns stored extra-shadow color; a new layer is opaque black.
GetStackedShadowCountint
public int GetStackedShadowCount();Nonnegative extra-shadow count. New layers have Offset = (1, 1), opaque black color and OutlineSize = 0. Shrinking discards tail layers.
intStored extra-shadow count.
GetStackedShadowOffsetVector2
public Vector2 GetStackedShadowOffset(int index);Returns stored shadow-layer offset, (1, 1) for a new layer.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexExisting zero-based layer index below the corresponding Count.
Vector2Returns stored shadow-layer offset, (1, 1) for a new layer.
GetStackedShadowOutlineSizeint
public int GetStackedShadowOutlineSize(int index);Returns stored shadow-layer outline thickness, 0 for a new layer.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexExisting zero-based layer index below the corresponding Count.
intReturns stored shadow-layer outline thickness, 0 for a new layer.
MoveStackedOutlinevoid
public void MoveStackedOutline(int fromIndex, int toPosition);Moves an existing layer to an insertion position before removing the source, 0…Count. Not a final index: (0, 1) retains order; (0, Count) appends the first. Unchanged order still emits Changed.
| Name | Type | Default |
|---|---|---|
fromIndex | int | — |
toPosition | int | — |
fromIndexExisting source index, 0…Count − 1.
toPositionInsertion position before source removal, inclusive 0…Count; not final index.
MoveStackedShadowvoid
public void MoveStackedShadow(int fromIndex, int toPosition);Moves the full shadow layer to insertion position 0…Count before source removal. Indices can shift; an unchanged-order move still emits Changed.
| Name | Type | Default |
|---|---|---|
fromIndex | int | — |
toPosition | int | — |
fromIndexExisting source index, 0…Count − 1.
toPositionInsertion position before source removal, inclusive 0…Count; not final index.
RemoveStackedOutlinevoid
public void RemoveStackedOutline(int index);Removes an existing outline at index 0…Count − 1. Later indices decrease; Count/property list refresh and Changed is emitted.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexExisting zero-based layer index below the corresponding Count.
RemoveStackedShadowvoid
public void RemoveStackedShadow(int index);Removes an existing shadow layer and shifts later indices. Index must exist; later Count growth does not restore deleted data.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexExisting zero-based layer index below the corresponding Count.
SetFontvoid
public void SetFont(Font font);Shared Font reference, or null for Label theme font. Assigned Font changes are forwarded through Changed; replacement disconnects the old resource. Default LabelSettings duplication does not make Font independent.
| Name | Type | Default |
|---|---|---|
font | Font | — |
fontShared Font reference, or null for Label theme font. Assigned Font changes are forwarded through Changed; replacement disconnects the old resource. Default LabelSettings duplication does not make Font independent.
SetFontColorvoid
public void SetFontColor(Color color);Main text color/alpha, default white. Editing a shared resource affects every Label using it. Does not set shadow/outline colors.
| Name | Type | Default |
|---|---|---|
color | Color | — |
colorMain text color/alpha, default white. Editing a shared resource affects every Label using it. Does not set shadow/outline colors.
SetFontSizevoid
public void SetFontSize(int size);Font size in pixels, default 16. Overrides theme font_size while LabelSettings is assigned. Supply a positive number; setter does not automatically constrain it.
| Name | Type | Default |
|---|---|---|
size | int | — |
sizeFont size in pixels, default 16. Overrides theme font_size while LabelSettings is assigned. Supply a positive number; setter does not automatically constrain it.
SetLineSpacingvoid
public void SetLineSpacing(float spacing);Additional line gap in pixels, default 3; fractions accepted. Not paragraph spacing, font size or wrapping width.
| Name | Type | Default |
|---|---|---|
spacing | float | — |
spacingAdditional line gap in pixels, default 3; fractions accepted. Not paragraph spacing, font size or wrapping width.
SetOutlineColorvoid
public void SetOutlineColor(Color color);Base outline color, default white. Visibility requires positive OutlineSize and nontransparent color. Does not change extra-layer colors.
| Name | Type | Default |
|---|---|---|
color | Color | — |
colorBase outline color, default white. Visibility requires positive OutlineSize and nontransparent color. Does not change extra-layer colors.
SetOutlineSizevoid
public void SetOutlineSize(int size);Base outline thickness in pixels, default 0. Nonnegative stacked thicknesses add to it. Does not reserve layout space.
| Name | Type | Default |
|---|---|---|
size | int | — |
sizeBase outline thickness in pixels, default 0. Nonnegative stacked thicknesses add to it. Does not reserve layout space.
SetParagraphSpacingvoid
public void SetParagraphSpacing(float spacing);Additional paragraph gap in pixels, default 0; fractions accepted. Configure the paragraph delimiter separately on Label.
| Name | Type | Default |
|---|---|---|
spacing | float | — |
spacingAdditional paragraph gap in pixels, default 0; fractions accepted. Configure the paragraph delimiter separately on Label.
SetShadowColorvoid
public void SetShadowColor(Color color);Base shadow color, default transparent black. Alpha 0 hides this shadow without disabling separate stacked shadows.
| Name | Type | Default |
|---|---|---|
color | Color | — |
colorBase shadow color, default transparent black. Alpha 0 hides this shadow without disabling separate stacked shadows.
SetShadowOffsetvoid
public void SetShadowOffset(Vector2 offset);Base shadow offset in local pixels, default (1, 1). Does not add Label minimum-size padding; parent clipping can cut the effect.
| Name | Type | Default |
|---|---|---|
offset | Vector2 | — |
offsetBase shadow offset in local pixels, default (1, 1). Does not add Label minimum-size padding; parent clipping can cut the effect.
SetShadowSizevoid
public void SetShadowSize(int size);Base shadow outline thickness in pixels, default 1. Not a blur radius. Transparent ShadowColor hides the base shadow.
| Name | Type | Default |
|---|---|---|
size | int | — |
sizeBase shadow outline thickness in pixels, default 1. Not a blur radius. Transparent ShadowColor hides the base shadow.
SetStackedOutlineColorvoid
public void SetStackedOutlineColor(int index, Color color);Sets an existing extra-outline color. Does not change its thickness or base OutlineColor.
| Name | Type | Default |
|---|---|---|
index | int | — |
color | Color | — |
indexExisting zero-based layer index below the corresponding Count.
colorSets an existing extra-outline color. Does not change its thickness or base OutlineColor.
SetStackedOutlineCountvoid
public void SetStackedOutlineCount(int count);Nonnegative extra-outline count. Growth adds Size = 0/black layers; shrinking removes the tail. Separate from the base OutlineSize outline.
| Name | Type | Default |
|---|---|---|
count | int | — |
countNonnegative extra-outline count. Growth adds Size = 0/black layers; shrinking removes the tail. Separate from the base OutlineSize outline.
SetStackedOutlineSizevoid
public void SetStackedOutlineSize(int index, int size);Sets existing layer’s added thickness in pixels. Positive values accumulate with base/previous outlines; ≤0 is not drawn. Use a nonnegative thickness.
| Name | Type | Default |
|---|---|---|
index | int | — |
size | int | — |
indexExisting zero-based layer index below the corresponding Count.
sizeSets existing layer’s added thickness in pixels. Positive values accumulate with base/previous outlines; ≤0 is not drawn. Use a nonnegative thickness.
SetStackedShadowColorvoid
public void SetStackedShadowColor(int index, Color color);Sets an existing shadow-layer color. Alpha 0 hides that layer without removing it or changing Count.
| Name | Type | Default |
|---|---|---|
index | int | — |
color | Color | — |
indexExisting zero-based layer index below the corresponding Count.
colorSets an existing shadow-layer color. Alpha 0 hides that layer without removing it or changing Count.
SetStackedShadowCountvoid
public void SetStackedShadowCount(int count);Nonnegative extra-shadow count. New layers have Offset = (1, 1), opaque black color and OutlineSize = 0. Shrinking discards tail layers.
| Name | Type | Default |
|---|---|---|
count | int | — |
countNonnegative extra-shadow count. New layers have Offset = (1, 1), opaque black color and OutlineSize = 0. Shrinking discards tail layers.
SetStackedShadowOffsetvoid
public void SetStackedShadowOffset(int index, Vector2 offset);Sets an existing shadow’s local pixel offset. Does not move Label or add layout padding.
| Name | Type | Default |
|---|---|---|
index | int | — |
offset | Vector2 | — |
indexExisting zero-based layer index below the corresponding Count.
offsetSets an existing shadow’s local pixel offset. Does not move Label or add layout padding.
SetStackedShadowOutlineSizevoid
public void SetStackedShadowOutlineSize(int index, int size);Sets nonnegative existing-shadow outline thickness in pixels. Expands its shape rather than Gaussian blur. Setter does not constrain the number.
| Name | Type | Default |
|---|---|---|
index | int | — |
size | int | — |
indexExisting zero-based layer index below the corresponding Count.
sizeSets nonnegative existing-shadow outline thickness in pixels. Expands its shape rather than Gaussian blur. Setter does not constrain the number.