Table of Contents

Struct NameplateStyle

Namespace
FishMMO.Shared.Core
Assembly
FishMMO.Shared.dll

How a nameplate is drawn: its type, its background, its border and its box.

[Serializable]
public struct NameplateStyle
Inherited Members

Remarks

A value type, so a style read from an asset cannot be mutated through the plate that borrowed it, and so a plate that authors its own style carries it inline rather than in a second object to keep alive.

Everything is authored in points at ReferenceFontSize. A plate is drawn at whatever size perspective gives it, so a padding authored in absolute points would swallow a distant plate and vanish on a near one. The renderer scales every measurement here by the plate's resolved font size over the reference, which keeps a plate's proportions the same at every distance — the one property a nameplate must have, since its whole job is to be recognised at a glance from wherever the player happens to be standing.

Alliance tinting is a blend, not a replacement. A background painted in the raw standing colour is a solid red or green box that fights the text it sits behind; a dark background nudged a third of the way toward that colour reads as hostile at a glance and still leaves the name legible. BackgroundBlend and BorderBlend are how far that nudge goes.

Fields

AnchorGap

Vertical distance in WORLD units between the anchor point and the bottom of the plate.

public float AnchorGap

Field Value

float

Remarks

Authored in world units so the gap over a character's head stays the same size as the character at every distance, which a point offset would not.

BackgroundBlend

How far the background moves toward the alliance tint, 0 to 1.

public float BackgroundBlend

Field Value

float

BackgroundColor

The background colour, or the base of its alliance blend.

public Color BackgroundColor

Field Value

Color

BackgroundOpacity

The background's final alpha, 0 to 1.

public float BackgroundOpacity

Field Value

float

BackgroundTint

Where the background colour comes from.

public NameplateTint BackgroundTint

Field Value

NameplateTint

BorderBlend

How far the border moves toward the alliance tint, 0 to 1.

public float BorderBlend

Field Value

float

BorderColor

The border colour, or the base of its alliance blend.

public Color BorderColor

Field Value

Color

BorderTint

Where the border colour comes from.

public NameplateTint BorderTint

Field Value

NameplateTint

BorderWidth

Border thickness, in points at ReferenceFontSize.

public float BorderWidth

Field Value

float

CornerRadius

Corner radius, in points at ReferenceFontSize.

public float CornerRadius

Field Value

float

FontSize

The name row's size in WORLD units; the renderer converts it to points by distance.

public float FontSize

Field Value

float

Remarks

World units rather than points for the same reason fontSize is: a plate shrinks with distance exactly as a piece of geometry over the character's head would, and a point size cannot express that.

LineHeight

The height of a row's box, as a multiple of that row's own font size.

public float LineHeight

Field Value

float

Remarks

A row left to size itself gets UI Toolkit's line box, which is roughly 1.3x the font size — leading that is right for a paragraph and far too loose for three words stacked over someone's head. Setting the height explicitly and centring the text in it is the only handle on that: UI Toolkit has no line-height property. Values below about 0.95 start clipping descenders on the tallest rows.

LineSpacing

The gap between rows, in points at ReferenceFontSize.

public float LineSpacing

Field Value

float

Remarks

With LineHeight at 1 this IS the gap a reader sees — four points at the reference size, growing with the plate like every other measurement here. It is worth having the two fields separate rather than folding the gap into the row height: the height decides where a row's text sits, the gap decides how far the next one is, and a single number would make "tighter" also mean "off-centre".

MinWidth

Smallest plate width, in points at ReferenceFontSize. Zero fits the rows.

public float MinWidth

Field Value

float

Remarks

A floor rather than a fixed width: a set of plates that are all the same width reads as a UI, and a set that each hug their own text reads as labels on the world. This exists so a one-letter name still gets a plate somebody can aim at.

NameBlend

How far the name colour moves toward the alliance tint when NameTint is Alliance. One is the standing colour itself.

public float NameBlend

Field Value

float

NameColor

The name row's colour, or the base of its alliance blend.

public Color NameColor

Field Value

Color

NameTint

Where the name row's colour comes from.

public NameplateTint NameTint

Field Value

NameplateTint

PaddingHorizontal

Padding left and right of the rows, in points at ReferenceFontSize.

public float PaddingHorizontal

Field Value

float

PaddingVertical

Padding above and below the rows, in points at ReferenceFontSize.

public float PaddingVertical

Field Value

float

ReferenceFontSize

The font size, in points, that every other measurement in this style is authored against.

public const float ReferenceFontSize = 14

Field Value

float

Remarks

Fourteen points is a nameplate at conversational distance with the default settings, so authored values read as the sizes a developer sees while standing in front of the thing they are tuning.

SecondaryColor

The colour of every row that is neither the name nor coloured by its writer.

public Color SecondaryColor

Field Value

Color

ShowBackground

Whether the plate paints a background behind its rows.

public bool ShowBackground

Field Value

bool

ShowBorder

Whether the plate draws a border. This is the "this one matters" switch: a boss, a rare spawn, a quest giver.

public bool ShowBorder

Field Value

bool

Properties

Default

The style a plate uses when it authors none of its own and references no asset.

public static NameplateStyle Default { get; }

Property Value

NameplateStyle

Remarks

A translucent near-black plate, the name in the standing colour, a background nudged a third of the way toward the same colour, and no border. That reproduces what the old stacked WorldLabel nameplates looked like — coloured name, coloured guild line, nothing behind them — with the background added, and it is what every character in the game gets until somebody says otherwise.

Methods

ResolveBackgroundColor(Color)

The colour the background is painted in, alpha included.

public Color ResolveBackgroundColor(Color allianceTint)

Parameters

allianceTint Color

The plate's current faction-standing tint.

Returns

Color

ResolveBorderColor(Color)

The colour the border is drawn in.

public Color ResolveBorderColor(Color allianceTint)

Parameters

allianceTint Color

The plate's current faction-standing tint.

Returns

Color

ResolveNameColor(Color)

The colour the name row is drawn in.

public Color ResolveNameColor(Color allianceTint)

Parameters

allianceTint Color

The plate's current faction-standing tint.

Returns

Color