SubtitlesGameObjectSystemclass

Knows which subtitle lines are being spoken in this scene right now. Sounds carry their own subtitle tracks (`Sandbox.SoundFile.Subtitles`, authored in the sound editor) - `Sandbox.SubtitlesGameObjectSystem.GetActive(System.Collections.Generic.List)` samples the ones playing in this scene. The built-in overlay renders them word by word; to draw your own UI instead, turn off "Show UI" in the project's platform settings and build it on this system.

objectGameObjectSystem<T>SubtitlesGameObjectSystem
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public sealed class Sandbox.SubtitlesGameObjectSystem : Sandbox.GameObjectSystem<T>

Constructors1

Showing 1 constructors

Methods2

Showing 2 methods

public void GetActive(System.Collections.Generic.List`1<Sandbox.SubtitlesGameObjectSystem.Line> lines)PUBLIC

ParameterTypeDescription
linesList<Line>
Returns:void

public void Show(string text, float duration = 3)PUBLIC

Show a subtitle that isn't attached to a sound - scripted dialogue, a radio voice you're streaming, whatever. The text is split into words spread over the duration, so it highlights word by word like a sound's subtitle track does. Main thread only.

ParameterTypeDescription
textstring
duration = 3float
Returns:void

On this page