GizmoDrawclass

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

objectGizmoDraw
Namespace
global
Assembly
Sandbox.Engine
Declaration
public sealed class Sandbox.Gizmo.GizmoDraw

Methods48

Showing 48 methods

public void Arrow(Vector3 from, Vector3 to, float arrowLength = 12, float arrowWidth = 5)PUBLIC

Draw a line with an arrow on the end

ParameterTypeDescription
fromVector3
toVector3
arrowLength = 12float
arrowWidth = 5float
Returns:void

public void LineBBox(BBox box)PUBLIC

Draw a bounding box

ParameterTypeDescription
boxBBox
Returns:void

public void LineCapsule(Capsule capsule, int rings = 12)PUBLIC

ParameterTypeDescription
capsuleCapsule
rings = 12int
Returns:void

public void LineCylinder(Vector3 vPointA, Vector3 vPointB, float flRadiusA, float flRadiusB, int nNumSegments)PUBLIC

A cylinder

ParameterTypeDescription
vPointAVector3
vPointBVector3
flRadiusAfloat
flRadiusBfloat
nNumSegmentsint
Returns:void

public void LineFrustum(Sandbox.Frustum frustum)PUBLIC

Draws a frustum.

ParameterTypeDescription
frustumFrustum
Returns:void

public void Lines(System.Collections.Generic.IEnumerable`1<Line> lines)PUBLIC

ParameterTypeDescription
linesIEnumerable<Line>
Returns:void

public void LineTriangle(Sandbox.Triangle triangle)PUBLIC

A triangle

ParameterTypeDescription
triangleTriangle
Returns:void

public void LineTriangles(System.Collections.Generic.IEnumerable`1<Sandbox.Triangle> triangles)PUBLIC

ParameterTypeDescription
trianglesIEnumerable<Triangle>
Returns:void

public void ScreenBiasedHalfCircle(Vector3 center, float radius)PUBLIC

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.

ParameterTypeDescription
centerVector3
radiusfloat
Returns:void

public void ScreenRect(Sandbox.Rect rect, Color color, Vector4 borderRadius = null, Color borderColor = null, Vector4 borderSize = null, Sandbox.BlendMode blendMode = 0)PUBLIC

Draw a rect, on the screen

ParameterTypeDescription
rectRect
colorColor
borderRadius = nullVector4
borderColor = nullColor
borderSize = nullVector4
blendMode = 0BlendMode
Returns:void

public void SolidBox(BBox box)PUBLIC

Draw a solid box shape

ParameterTypeDescription
boxBBox
Returns:void

public void SolidCapsule(Vector3 start, Vector3 end, float radius, int hSegments, int vSegments)PUBLIC

Draw a solid capsule shape

ParameterTypeDescription
startVector3
endVector3
radiusfloat
hSegmentsint
vSegmentsint
Returns:void

public void SolidCircle(Vector3 center, float radius, float startAngle = 0, float totalDegrees = 360, int sections = 8)PUBLIC

Draw a filled circle

ParameterTypeDescription
centerVector3
radiusfloat
startAngle = 0float
totalDegrees = 360float
sections = 8int
Returns:void

public void SolidCone(Vector3 base, Vector3 extent, float flRadius, System.Nullable`1<int> segments = null)PUBLIC

ParameterTypeDescription
baseVector3
extentVector3
flRadiusfloat
segments = nullNullable<int>
Returns:void

public void SolidCylinder(Vector3 start, Vector3 end, float radius, int hSegments = 32)PUBLIC

Draw a solid cylinder shape

ParameterTypeDescription
startVector3
endVector3
radiusfloat
hSegments = 32int
Returns:void

public void SolidRing(Vector3 center, float innerRadius, float outerRadius, float startAngle = 0, float totalDegrees = 360, int sections = 8)PUBLIC

Draw a filled ring

ParameterTypeDescription
centerVector3
innerRadiusfloat
outerRadiusfloat
startAngle = 0float
totalDegrees = 360float
sections = 8int
Returns:void

public void SolidSphere(Vector3 center, float radius, int hSegments = 8, int vSegments = 8)PUBLIC

Draw a solid sphere shape

ParameterTypeDescription
centerVector3
radiusfloat
hSegments = 8int
vSegments = 8int
Returns:void

public void SolidTriangles(System.Collections.Generic.IEnumerable`1<Sandbox.Triangle> triangles)PUBLIC

ParameterTypeDescription
trianglesIEnumerable<Triangle>
Returns:void

public void Text(string text, Transform tx, string font = Roboto, float size = 12, Sandbox.TextFlag flags = 132)PUBLIC

Draw text

ParameterTypeDescription
textstring
txTransform
font = Robotostring
size = 12float
flags = 132TextFlag
Returns:void

public void WorldText(string text, Transform tx, string font = Roboto, float size = 12, Sandbox.TextFlag flags = 132)PUBLIC

ParameterTypeDescription
textstring
txTransform
font = Robotostring
size = 12float
flags = 132TextFlag
Returns:void

Properties4

Showing 4 properties

public bool Sandbox.Gizmo.GizmoDraw.CullBackfaces { get; set; }PUBLICGETSET

Don't draw backfaces when drawing solids

Returns:bool

public bool Sandbox.Gizmo.GizmoDraw.IgnoreDepth { get; set; }PUBLICGETSET

Ignore depth when drawing, draw on top of everything

Returns:bool

public float Sandbox.Gizmo.GizmoDraw.LineThickness { get; set; }PUBLICGETSET

The thickness of line drawings

Returns:float

On this page

Methodspublic System.Void Arrow(Vector3 from, Vector3 to, System.Single arrowLength = 12, System.Single arrowWidth = 5)public System.Void Grid(Sandbox.Gizmo.GridAxis axis, System.Single spacing = 32, System.Single opacity = 1, System.Single minorLineWidth = 0.01, System.Single majorLineWidth = 0.02)public System.Void Grid(Sandbox.Gizmo.GridAxis axis, Vector2 spacing = null, System.Single opacity = 1, System.Single minorLineWidth = 0.01, System.Single majorLineWidth = 0.02)public System.Void Grid(Vector3 center, Sandbox.Gizmo.GridAxis axis, Vector2 spacing = null, System.Single opacity = 1, System.Single minorLineWidth = 0.01, System.Single majorLineWidth = 0.02)public System.Void Line(Line line)public System.Void Line(Vector3 a, Vector3 b)public System.Void LineBBox(BBox box)public System.Void LineCapsule(Capsule capsule, System.Int32 rings = 12)public System.Void LineCircle(Vector3 center, System.Single radius, System.Single startAngle = 0, System.Single totalDegrees = 360, System.Int32 sections = 16)public System.Void LineCircle(Vector3 center, Vector3 forward, System.Single radius, System.Single startAngle = 0, System.Single totalDegrees = 360, System.Int32 sections = 16)public System.Void LineCircle(Vector3 center, Vector3 forward, Vector3 up, System.Single radius, System.Single startAngle = 0, System.Single totalDegrees = 360, System.Int32 sections = 16)public System.Void LineCylinder(Vector3 vPointA, Vector3 vPointB, System.Single flRadiusA, System.Single flRadiusB, System.Int32 nNumSegments)public System.Void LineFrustum(Sandbox.Frustum frustum)public System.Void Lines(System.Collections.Generic.IEnumerable`1<Line> lines)public System.Void LineSphere(Sandbox.Sphere sphere, System.Int32 rings = 8)public System.Void LineSphere(Vector3 point, System.Single radius, System.Int32 rings = 8)public System.Void LineTriangle(Sandbox.Triangle triangle)public System.Void LineTriangles(System.Collections.Generic.IEnumerable`1<Sandbox.Triangle> triangles)public Sandbox.SceneModel Model(Sandbox.Model model, Transform localTransform)public Sandbox.SceneModel Model(Sandbox.Model modelName)public Sandbox.SceneModel Model(System.String modelName, Transform localTransform)public Sandbox.SceneModel Model(System.String modelName)public System.Void Particles(System.String modelName, System.Nullable`1<System.Single> updateSpeed = null)public System.Void Particles(System.String modelName, Transform localTransform, System.Nullable`1<System.Single> updateSpeed = null)public System.Void Plane(Vector3 position, Vector3 normal)public System.Void ScreenBiasedHalfCircle(Vector3 center, System.Single radius)public System.Void ScreenRect(Sandbox.Rect rect, Color color, Vector4 borderRadius = null, Color borderColor = null, Vector4 borderSize = null, Sandbox.BlendMode blendMode = 0)public System.Void ScreenText(Sandbox.TextRendering.Scope text, Sandbox.Rect rect, System.Single angle, Sandbox.TextFlag flags = 33)public System.Void ScreenText(Sandbox.TextRendering.Scope text, Vector2 pos, Sandbox.TextFlag flags = 33)public System.Void ScreenText(Sandbox.TextRendering.Scope text, Vector3 worldPos, Vector2 offset, Sandbox.TextFlag flags = 33)public System.Void ScreenText(System.String text, Vector2 pos, System.String font = Roboto, System.Single size = 12, Sandbox.TextFlag flags = 33)public System.Void ScreenText(System.String text, Vector3 worldPos, Vector2 offset, System.String font = Roboto, System.Single size = 12, Sandbox.TextFlag flags = 33)public System.Void SolidBox(BBox box)public System.Void SolidCapsule(Vector3 start, Vector3 end, System.Single radius, System.Int32 hSegments, System.Int32 vSegments)public System.Void SolidCircle(Vector3 center, System.Single radius, System.Single startAngle = 0, System.Single totalDegrees = 360, System.Int32 sections = 8)public System.Void SolidCone(Vector3 base, Vector3 extent, System.Single flRadius, System.Nullable`1<System.Int32> segments = null)public System.Void SolidCylinder(Vector3 start, Vector3 end, System.Single radius, System.Int32 hSegments = 32)public System.Void SolidRing(Vector3 center, System.Single innerRadius, System.Single outerRadius, System.Single startAngle = 0, System.Single totalDegrees = 360, System.Int32 sections = 8)public System.Void SolidSphere(Vector3 center, System.Single radius, System.Int32 hSegments = 8, System.Int32 vSegments = 8)public System.Void SolidTriangle(Sandbox.Triangle triangle)public System.Void SolidTriangle(Vector3 a, Vector3 b, Vector3 c)public System.Void SolidTriangles(System.Collections.Generic.IEnumerable`1<Sandbox.Triangle> triangles)public System.Void Sprite(Vector3 center, System.Single size, Sandbox.Texture texture)public System.Void Sprite(Vector3 center, System.Single size, System.String texture)public System.Void Sprite(Vector3 center, Vector2 size, Sandbox.Texture texture, System.Boolean worldspace, System.Single angle)public System.Void Sprite(Vector3 center, Vector2 size, Sandbox.Texture texture, System.Boolean worldspace)public System.Void Text(System.String text, Transform tx, System.String font = Roboto, System.Single size = 12, Sandbox.TextFlag flags = 132)public System.Void WorldText(System.String text, Transform tx, System.String font = Roboto, System.Single size = 12, Sandbox.TextFlag flags = 132)Propertiespublic Color Sandbox.Gizmo.GizmoDraw.Color { get; set; }public System.Boolean Sandbox.Gizmo.GizmoDraw.CullBackfaces { get; set; }public System.Boolean Sandbox.Gizmo.GizmoDraw.IgnoreDepth { get; set; }public System.Single Sandbox.Gizmo.GizmoDraw.LineThickness { get; set; }Metadata