Description
The Hud
property of the CameraComponent
class provides access to a HudPainter
object, which allows for drawing on the camera. This drawing occurs before any post-processing effects are applied, making it suitable for rendering HUD elements or other overlays that should not be affected by post-processing.
Usage
To use the Hud
property, you can access it from an instance of CameraComponent
. You can then use the HudPainter
to draw various elements on the camera view. This is particularly useful for creating custom HUDs or other visual elements that need to be rendered directly onto the camera's view.
Example
// Assuming 'cameraComponent' is an instance of CameraComponent
var hudPainter = cameraComponent.Hud;
// Use the hudPainter to draw elements
hudPainter.DrawText("Hello, World!", new Vector2(100, 100), Color.White);