The DrawQuad
method is a static function in the Sandbox.Graphics
class that allows you to draw a quadrilateral on the screen. This method requires a rectangle, a material, a color, and render attributes to define how the quad should be rendered.
The DrawQuad
method is a static function in the Sandbox.Graphics
class that allows you to draw a quadrilateral on the screen. This method requires a rectangle, a material, a color, and render attributes to define how the quad should be rendered.
To use the DrawQuad
method, you need to provide the following parameters:
rect
: A reference to a Sandbox.Rect
that defines the position and size of the quad.material
: A reference to a Sandbox.Material
that specifies the material properties to be used for rendering the quad.color
: A reference to a Color
that determines the color tint to apply to the quad.attributes
: A Sandbox.RenderAttributes
object that contains additional rendering attributes.This method does not return a value.
// Example of using DrawQuad // Define a rectangle Rect rect = new Rect(0, 0, 100, 100); // Create a material Material material = new Material(); // Define a color Color color = new Color(1.0f, 0.5f, 0.5f, 1.0f); // RGBA // Define render attributes RenderAttributes attributes = new RenderAttributes(); // Draw the quad Graphics.DrawQuad(ref rect, ref material, ref color, attributes);