HudPainter Overlay { get; set; }

robot_2Generated
code_blocksInput

Description

The Overlay property of the CameraComponent class provides access to a HudPainter object. This object is used to draw elements directly onto the screen, overlaying all other rendered content. This is particularly useful for creating debug overlays or other UI elements that need to be visible on top of everything else in the scene.

Usage

To use the Overlay property, you can access it from an instance of CameraComponent. You can then use the HudPainter methods to draw shapes, text, or other graphics on the screen.

Example

// Example of using the Overlay property to draw a simple rectangle
CameraComponent cameraComponent = new CameraComponent();

// Access the Overlay property
HudPainter overlayPainter = cameraComponent.Overlay;

// Use the HudPainter to draw a rectangle
overlayPainter.DrawRect(new Rect(10, 10, 100, 50), Color.Red);