Description
The CreateCenteredQuad
method is a member of the MapStaticOverlay
class within the Editor.MapDoc
namespace. This method is used to create a centered quad overlay on a map. The quad is defined by a size and a material, and it is rendered using a mesh that is generated by projecting faces onto surrounding geometry. This overlay is baked during map compilation, ensuring there is no runtime component, and it can be limited to specific targets.
Usage
To use the CreateCenteredQuad
method, you need to provide two parameters:
size
: A Vector2
representing the dimensions of the quad.
material
: A Sandbox.Material
object that defines the appearance of the quad.
This method does not return a value.
Example
// Example of using CreateCenteredQuad
// Define the size of the quad
Vector2 quadSize = new Vector2(10.0f, 10.0f);
// Define the material for the quad
Material quadMaterial = new Material("path/to/material");
// Create an instance of MapStaticOverlay
MapStaticOverlay overlay = new MapStaticOverlay();
// Create the centered quad
overlay.CreateCenteredQuad(quadSize, quadMaterial);