API ReferenceSandbox.Rendering
HudPainterclass
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.
object→HudPainter
Constructors1
Showing 1 constructors
public HudPainter(Sandbox.Rendering.CommandList commandList)
Initializes a new instance of the `Sandbox.Rendering.HudPainter` struct for the specified `commandList`.
| Parameter | Type | Description |
|---|---|---|
| commandList | CommandList | The command list to draw to. Must not be null. |
No results match this filter.
Methods11
Showing 11 methods
public void DrawCircle(Vector2 position, Vector2 size, Color color)
Draws a filled circle at the specified position and size.
| Parameter | Type | Description |
|---|---|---|
| position | Vector2 | The center position of the circle. |
| size | Vector2 | The size (diameter) of the circle. |
| color | Color | The color of the circle. |
Returns:
void—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.
| Parameter | Type | Description |
|---|---|---|
| a | Vector2 | The start point of the line. |
| b | Vector2 | The end point of the line. |
| width | float | The width of the line. |
| color | Color | The color of the line. |
| corners = null | Vector4 | Optional corner flags for line end caps. |
Returns:
void—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.
| Parameter | Type | Description |
|---|---|---|
| rect | Rect | The rectangle to draw. |
| color | Color | The fill color of the rectangle. |
| cornerRadius = null | Vector4 | The radius for each corner (optional). |
| borderWidth = null | Vector4 | The width of the border for each edge (optional). |
| borderColor = null | Color | The color of the border (optional). |
Returns:
void—public void SetBlendMode(Sandbox.BlendMode mode)
Sets the blend mode for subsequent drawing operations.
| Parameter | Type | Description |
|---|---|---|
| mode | BlendMode | The blend mode to use. |
Returns:
void—No results match this filter.