Api GizmoDraw
class

GizmoDraw

public sealed class GizmoDraw

Contains functions to add objects to the Gizmo Scene. This is an instantiable class so it's possible to add extensions.

Properties

Name Type Description
Color Color The color to render the next object
IgnoreDepth Boolean Ignore depth when drawing, draw on top of everything
LineThickness Single The thickness of line drawings
CullBackfaces Boolean Don't draw backfaces when drawing solids

Methods

SceneModel Model(String modelName, Transform localTransform)

Draw a model

SceneModel Model(String modelName)

Draw a model

SceneModel Model(Model model, Transform localTransform)

Draw a model

SceneModel Model(Model modelName)

Draw a model

Void Particles(String modelName, Transform localTransform, Single? updateSpeed = null)
Void Particles(String modelName, Single? updateSpeed = null)
Void Text(String text, Transform tx, String font = Roboto, Single size = 12, TextFlag flags = 132)

Draw text

Void WorldText(String text, Transform tx, String font = Roboto, Single size = 12, TextFlag flags = 132)
Void ScreenText(String text, Vector2 pos, String font = Roboto, Single size = 12, TextFlag flags = 33)

Draw text

Void ScreenText(Scope text, Vector2 pos, TextFlag flags = 33)

Draw text with a text rendering scope for more text rendering customization.

Void ScreenText(String text, Vector3 worldPos, Vector2 offset, String font = Roboto, Single size = 12, TextFlag flags = 33)

Draw text on screen at a 3d position

Void ScreenText(Scope text, Vector3 worldPos, Vector2 offset, TextFlag flags = 33)

Draw text on screen at a 3d position with a text rendering scope for more text rendering customization.

Void ScreenText(Scope text, Rect rect, Single angle, TextFlag flags = 33)

Draw text at an angle

Void ScreenRect(Rect rect, Color color, Vector4 borderRadius = null, Color borderColor = null, Vector4 borderSize = null, BlendMode blendMode = 0)

Draw a rect, on the screen

Void Plane(Vector3 position, Vector3 normal)

Draw a plane

Void Arrow(Vector3 from, Vector3 to, Single arrowLength = 12, Single arrowWidth = 5)

Draw a line with an arrow on the end

Void Grid(GridAxis axis, Single spacing = 32, Single opacity = 1, Single minorLineWidth = 0.01, Single majorLineWidth = 0.02)

Draws a grid

Void Grid(GridAxis axis, Vector2 spacing = null, Single opacity = 1, Single minorLineWidth = 0.01, Single majorLineWidth = 0.02)

Draws a grid

Void Grid(Vector3 center, GridAxis axis, Vector2 spacing = null, Single opacity = 1, Single minorLineWidth = 0.01, Single majorLineWidth = 0.02)

Draws a grid centered at a position

Void Line(Vector3 a, Vector3 b)

Draw a line from a to b

Void Line(Line line)

Draw a line from a to b

Void Lines(IEnumerable<Line> lines)
Void LineBBox(BBox box)

Draw a bounding box

Void LineFrustum(Frustum frustum)

Draws a frustum.

Void LineSphere(Vector3 point, Single radius, Int32 rings = 8)

Draw a sphere made out of lines

Void LineSphere(Sphere sphere, Int32 rings = 8)

Draw a sphere made out of lines

Void LineCircle(Vector3 center, Single radius, Single startAngle = 0, Single totalDegrees = 360, Int32 sections = 16)

Draw a sphere made out of lines

Void LineCircle(Vector3 center, Vector3 forward, Single radius, Single startAngle = 0, Single totalDegrees = 360, Int32 sections = 16)
Void LineCircle(Vector3 center, Vector3 forward, Vector3 up, Single radius, Single startAngle = 0, Single totalDegrees = 360, Int32 sections = 16)
Void LineCylinder(Vector3 vPointA, Vector3 vPointB, Single flRadiusA, Single flRadiusB, Int32 nNumSegments)

A cylinder

Void LineCapsule(Capsule capsule, Int32 rings = 12)
Void LineTriangle(Triangle triangle)

A triangle

Void LineTriangles(IEnumerable<Triangle> triangles)
Void SolidCone(Vector3 base, Vector3 extent, Single flRadius, Int32? segments = null)
Void SolidBox(BBox box)

Draw a solid box shape

Void SolidTriangle(Triangle triangle)

Draw a solid triangle shape

Void SolidTriangle(Vector3 a, Vector3 b, Vector3 c)

Draw a solid triangle shape

Void SolidTriangles(IEnumerable<Triangle> triangles)
Void SolidCircle(Vector3 center, Single radius, Single startAngle = 0, Single totalDegrees = 360, Int32 sections = 8)

Draw a filled circle

Void SolidRing(Vector3 center, Single innerRadius, Single outerRadius, Single startAngle = 0, Single totalDegrees = 360, Int32 sections = 8)

Draw a filled ring

Void SolidSphere(Vector3 center, Single radius, Int32 hSegments = 8, Int32 vSegments = 8)

Draw a solid sphere shape

Void SolidCylinder(Vector3 start, Vector3 end, Single radius, Int32 hSegments = 32)

Draw a solid cylinder shape

Void SolidCapsule(Vector3 start, Vector3 end, Single radius, Int32 hSegments, Int32 vSegments)

Draw a solid capsule shape

Void ScreenBiasedHalfCircle(Vector3 center, Single radius)

Draws a half circle that tries its best to point towards the camera. This is used by the rotation widgets that bias towards the camera.

Void Sprite(Vector3 center, Single size, String texture)

Draw a sprite.

Void Sprite(Vector3 center, Single size, Texture texture)

Draw a sprite.

Void Sprite(Vector3 center, Vector2 size, Texture texture, Boolean worldspace)

Draw a sprite.

Void Sprite(Vector3 center, Vector2 size, Texture texture, Boolean worldspace, Single angle)

Draw a sprite.

Assembly: Sandbox.Engine Declaring Type: Gizmo Full Name: Sandbox.Gizmo.GizmoDraw