logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class HudPreviewValues

    Turns an element's authored preview text into a readable binding, so a HUD can be laid out before any service is running.

    Inheritance
    object
    HudPreviewValues
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.GameUi.Application.Binding
    Assembly: Serenity.GameUi.Application.dll
    Syntax
    public static class HudPreviewValues
    Remarks

    Deliberately does not fall back to a made-up value. Choosing where a value comes from and choosing what to look at while positioning the element are separate decisions, and only the author can make the second: a framework that guesses ends up encoding one game's specifics into every other game's HUD.

    Methods

    Compile(string, IHudBinding)

    Compiles authored preview text into a constant binding.

    Declaration
    public static CompiledHudBinding Compile(string previewText, IHudBinding binding)
    Parameters
    Type Name Description
    string previewText

    The authored stand-in, or empty for none.

    IHudBinding binding

    The real binding, consulted for its fallback text and its value transform. The transform is applied to the preview exactly as it would be at runtime — the preview's whole premise is running the real binding and drawing code with sample data, not a parallel approximation of it.

    Returns
    Type Description
    CompiledHudBinding

    A constant binding over the parsed value, or null when nothing was authored — the caller then shows what the runtime would show with no data.

    In this article
    © 2026 Serenity. All Rights Reserved