Files
sbox-public/engine/Sandbox.Engine/Scene/Components/Camera/CameraComponent.Hud.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

29 lines
909 B
C#

using Sandbox.Rendering;
namespace Sandbox;
public sealed partial class CameraComponent : Component, Component.ExecuteInEditor
{
CommandList _hudCommandList = new CommandList( "Hud" ) { Flags = CommandList.Flag.Hud };
/// <summary>
/// Allows drawing on the camera. This is drawn before the post processing.
/// </summary>
public HudPainter Hud => new HudPainter( _hudCommandList );
CommandList _overlayCommandList = new CommandList( "Overlay" ) { Flags = CommandList.Flag.Hud };
/// <summary>
/// Used to draw to the screen. This is drawn on top of everything, so is good for debug overlays etc.
/// </summary>
public HudPainter Overlay => new HudPainter( _overlayCommandList );
void Component.ISceneStage.Start()
{
// Clear the HUD at the start of every frame, so that
// subsequent Update()'s will give it fresh data.
_hudCommandList.Reset();
_overlayCommandList.Reset();
}
}