static void DrawQuad( Sandbox.Rect& rect, Sandbox.Material& material, Color& color, RenderAttributes attributes )

book_4_sparkGenerated
code_blocksInput

Description

The DrawQuad method in the Sandbox.Graphics class is a static method used to render a quadrilateral (quad) on the screen. This method allows you to specify the rectangle area, material, color, and additional rendering attributes for the quad.

Usage

To use the DrawQuad method, you need to provide the following parameters:

  • rect: A reference to a Sandbox.Rect structure that defines the position and size of the quad.
  • material: A reference to a Sandbox.Material that specifies the material to be used for rendering the quad.
  • color: A reference to a Color structure that defines the color of the quad.
  • attributes: A Sandbox.RenderAttributes object that contains additional rendering attributes.

This method does not return a value.

Example

// Example of using DrawQuad

// Define the rectangle area for the quad
Rect quadRect = new Rect(0, 0, 100, 100);

// Define the material to use
Material quadMaterial = new Material();

// Define the color of the quad
Color quadColor = new Color(1.0f, 0.0f, 0.0f, 1.0f); // Red color

// Define additional render attributes
RenderAttributes renderAttributes = new RenderAttributes();

// Draw the quad
Graphics.DrawQuad(ref quadRect, ref quadMaterial, ref quadColor, renderAttributes);