public sealed struct Sandbox.Rendering.HudPainter
2D Drawing functions for a `Sandbox.Rendering.CommandList`. `HudPainter` provides a set of methods for drawing shapes, textures, and text onto a command list, typically for HUD or UI rendering.
Related Guides
Broader workflow and conceptual references connected to this API.
Constructors
Showing 1 constructors
public HudPainter(Sandbox.Rendering.CommandList commandList)
Initializes a new instance of the `Sandbox.Rendering.HudPainter` struct for the specified `commandList`.
Parameters
commandList: The command list to draw to. Must not be null.
No results match this filter.
Methods
Showing 11 methods
public void DrawCircle(Vector2 position, Vector2 size, Color color)
Draws a filled circle at the specified position and size.
Parameters
position: The center position of the circle.size: The size (diameter) of the circle.color: The color of the circle.
public void DrawLine(Vector2 a, Vector2 b, float width, Color color, Vector4 corners = null)
Draws a line between two points with the specified width and color.
Parameters
a: The start point of the line.b: The end point of the line.width: The width of the line.color: The color of the line.corners: Optional corner flags for line end caps. Default: null
public void DrawRect(Sandbox.Rect rect, Color color, Vector4 cornerRadius = null, Vector4 borderWidth = null, Color borderColor = null)
Draws a rectangle with optional corner radius and border.
Parameters
rect: The rectangle to draw.color: The fill color of the rectangle.cornerRadius: The radius for each corner (optional). Default: nullborderWidth: The width of the border for each edge (optional). Default: nullborderColor: The color of the border (optional). Default: null
public void SetBlendMode(Sandbox.BlendMode mode)
Sets the blend mode for subsequent drawing operations.
Parameters
mode: The blend mode to use.
public void SetMatrix(Matrix matrix)
Sets the transformation matrix for subsequent drawing operations.
Parameters
matrix: The transformation matrix to apply.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox.Rendering |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.Rendering.HudPainter |