Table of Contents

Class UITKAdvancedLabel

Namespace
FishMMO.Client
Assembly
FishMMO.Client.dll

A transient caption drawn at a screen position, with optional fade and upward drift. Used for region names and similar one-off announcements.

[DisallowMultipleComponent]
public sealed class UITKAdvancedLabel : MonoBehaviour, IReference
Inheritance
Object
Component
Behaviour
MonoBehaviour
UITKAdvancedLabel
Implements
Inherited Members
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.destroyCancellationToken
MonoBehaviour.useGUILayout
MonoBehaviour.didStart
MonoBehaviour.didAwake
MonoBehaviour.runInEditMode
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.GetComponentIndex()
Component.CompareTag(TagHandle)
Component.transform
Component.transformHandle
Component.gameObject
Component.tag
Object.GetEntityId()
Object.GetInstanceID()
Object.GetHashCode()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Scene)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.FindObjectsByType<T>()
Object.FindObjectsByType<T>(FindObjectsInactive)
Object.ToString()
Object.name
Object.hideFlags

Remarks

Replaces the IMGUI-based UIAdvancedLabel, which drew through GUI.Label in an OnGUI pass — a separate immediate-mode render path that measured its own text with GUIStyle.CalcSize and positioned everything by hand against Screen.width.

The public surface is deliberately identical: Create(string, FontStyle, Font, int, Color, float, bool, bool, Vector2), Initialize(string, FontStyle, Font, int, Color, float, bool, bool, Vector2), SetText(string), SetColor(Color), ChangeFont(int) and SetPosition(Vector3) keep their old signatures, including the legacy FontStyle and Font parameters. DisplayRegionNameAction in FishMMO-Shared raises its event with those types and the server compiles that file too, so leaving the signature alone keeps a rendering change out of the shared assembly.

The element lives in ScreenContainer rather than in a document of its own, because these are created at runtime with a bare new GameObject and have nowhere to hang a UIDocument.

Fields

FadeColor

If true, the label colour fades in then out over its lifetime.

public bool FadeColor

Field Value

bool

FadeTime

Total fade time for the label in seconds.

public float FadeTime

Field Value

float

IncreaseY

If true, the label drifts upward over its lifetime.

public bool IncreaseY

Field Value

bool

OldY

The starting Y offset for upward movement.

public float OldY

Field Value

float

PixelOffset

Pixel offset from the centre of the screen.

public Vector2 PixelOffset

Field Value

Vector2

RemainingLife

Remaining lifetime of the label in seconds.

public float RemainingLife

Field Value

float

TargetColor

Colour the label fades towards.

public Color TargetColor

Field Value

Color

Text

The text displayed by the label.

public string Text

Field Value

string

YIncreaseValue

The target Y offset for upward movement.

public float YIncreaseValue

Field Value

float

Methods

ChangeFont(int)

Changes the font size of the label.

public void ChangeFont(int fontSize)

Parameters

fontSize int

New font size.

Create(string, FontStyle, Font, int, Color, float, bool, bool, Vector2)

Creates a new label instance and initializes it with the provided parameters.

public static IReference Create(string text, FontStyle style, Font font, int fontSize, Color color, float lifeTime, bool fadeColor, bool increaseY, Vector2 pixelOffset)

Parameters

text string

Text to display.

style FontStyle

Font style.

font Font

Font to use. Ignored — the panel's theme supplies the face.

fontSize int

Font size.

color Color

Text color.

lifeTime float

Lifetime of the label in seconds.

fadeColor bool

If true, label fades color over time.

increaseY bool

If true, label moves upward over time.

pixelOffset Vector2

Pixel offset for label placement.

Returns

IReference

Reference to the created label.

Initialize(string, FontStyle, Font, int, Color, float, bool, bool, Vector2)

Initializes the label with the provided parameters.

public void Initialize(string text, FontStyle fontStyle, Font font, int fontSize, Color color, float lifeTime, bool fadeColor, bool increaseY, Vector2 pixelOffset)

Parameters

text string

Text to display.

fontStyle FontStyle

Font style.

font Font

Font to use. Ignored — the panel's theme supplies the face.

fontSize int

Font size.

color Color

Text color.

lifeTime float

Lifetime of the label in seconds.

fadeColor bool

If true, label fades color over time.

increaseY bool

If true, label moves upward over time.

pixelOffset Vector2

Pixel offset for label placement.

SetColor(Color)

Sets the label's color.

public void SetColor(Color color)

Parameters

color Color

New color to set.

SetPosition(Vector3)

Sets the world position of the label's transform.

public void SetPosition(Vector3 position)

Parameters

position Vector3

World position to set.

SetText(string)

Sets the label's text.

public void SetText(string text)

Parameters

text string

New text to display.