logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class CutsceneDialogStageRules

    The numbers and rules every surface shares for a ShowDialog stage: the shortest time a line stays on screen, the duration a freshly chosen dialog stage starts with, when a stage has nothing to show, and the sentences authoring tools use to warn about it.

    Inheritance
    object
    CutsceneDialogStageRules
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.CutscenePlayer.Domain.ValueObjects
    Assembly: Serenity.CutscenePlayer.Domain.dll
    Syntax
    public static class CutsceneDialogStageRules

    Fields

    DefaultDialogSeconds

    The duration, in seconds, a stage starts with when its type is switched to a dialog.

    Declaration
    public const float DefaultDialogSeconds = 3
    Field Value
    Type Description
    float

    MinimumDialogSeconds

    The shortest time, in seconds, a dialog stage stays on screen.

    Declaration
    public const float MinimumDialogSeconds = 0.5
    Field Value
    Type Description
    float

    Methods

    DescribeLine(string, string)

    A one-line summary of what a dialog stage shows, for a card or a status line: the speaker, then the line in quotes. Line breaks are collapsed first, then a summary longer than the maximum is cut from the right with an ellipsis. A stage with no speaker shows the line alone; one with no line says so.

    Declaration
    public static string DescribeLine(string speaker, string dialogText)
    Parameters
    Type Name Description
    string speaker

    The name shown above the line.

    string dialogText

    The line the stage shows.

    Returns
    Type Description
    string

    DescribeProblems(int, string, float, string, string)

    What is wrong with a dialog stage, in the words an author reads, each naming the stage and the way forward; empty when the stage is fine. A stage with nothing to show reports only that, because its duration no longer matters. Numbers are written with the invariant decimal point.

    Declaration
    public static List<string> DescribeProblems(int stageNumber, string stageId, float durationSeconds, string speaker, string dialogText)
    Parameters
    Type Name Description
    int stageNumber

    The stage's one-based position in the cutscene.

    string stageId

    The stage's id, or empty when the stage has none.

    float durationSeconds

    The stage's authored duration.

    string speaker

    The name shown above the line.

    string dialogText

    The line the stage shows.

    Returns
    Type Description
    List<string>

    DurationAfterTypeChange(CutsceneStageType, CutsceneStageType, float)

    The duration a stage keeps after its type changes: the default when it just became a dialog and was shorter than the minimum, otherwise unchanged.

    Declaration
    public static float DurationAfterTypeChange(CutsceneStageType previousType, CutsceneStageType newType, float durationSeconds)
    Parameters
    Type Name Description
    CutsceneStageType previousType
    CutsceneStageType newType
    float durationSeconds
    Returns
    Type Description
    float

    HasNoContent(string, string)

    Whether a stage has neither a speaker nor a line; whitespace counts as empty.

    Declaration
    public static bool HasNoContent(string speaker, string dialogText)
    Parameters
    Type Name Description
    string speaker
    string dialogText
    Returns
    Type Description
    bool

    IsShorterThanMinimum(float)

    Whether the duration is below the minimum. Written as a negated comparison on purpose: NaN fails every comparison, so a value that is not a number counts as below the minimum.

    Declaration
    public static bool IsShorterThanMinimum(float durationSeconds)
    Parameters
    Type Name Description
    float durationSeconds
    Returns
    Type Description
    bool

    PlayedSeconds(float)

    How long a dialog stage stays on screen: its duration, raised to the minimum when shorter.

    Declaration
    public static float PlayedSeconds(float durationSeconds)
    Parameters
    Type Name Description
    float durationSeconds
    Returns
    Type Description
    float
    In this article
    © 2026 Serenity. All Rights Reserved