Table of Contents

Class Gizmos

Namespace
Cobilas.GodotEngine.Utility
Assembly
com.cobilas.godot.utility.dll

Gizmos are used to give visual debugging or setup aids in the Scene view.

public static class Gizmos
Inheritance
Gizmos
Inherited Members

Properties

Color

Sets the Color of the gizmos that are drawn next.

public static Color Color { get; set; }

Property Value

Color

Returns or sets the color of the next gizmo.

Methods

DrawArc(Vector2, float, float, float, int)

Draws a unfilled arc between the given angles. The larger the value of point_count, the smoother the curve. See also DrawCircle(Vector2, float, Color).

Note: Line drawing is not accelerated by batching if antialiased is true.

Note: Due to how it works, built-in antialiasing will not look correct for translucent lines and may not work on certain platforms. As a workaround, install the Antialiased Line2D add-on then create an AntialiasedRegularPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing. 2D batching is also still supported with those antialiased lines.

public static void DrawArc(Vector2 center, float radius, float startAngle, float endAngle, int pointCount)

Parameters

center Vector2

The central position of the arc.

radius float

The radius of the arc.

startAngle float

The angle at which the arc will be drawn.

endAngle float

The angle where the arc will finish being drawn.

pointCount int

The number of stitches used in the arc.

This parameter will define the visual aspect of the bow, whether it will have a smoother or more serrated curve.

DrawArc(Vector2, float, float, float, int, float)

Draws a unfilled arc between the given angles. The larger the value of point_count, the smoother the curve. See also DrawCircle(Vector2, float, Color).

Note: Line drawing is not accelerated by batching if antialiased is true.

Note: Due to how it works, built-in antialiasing will not look correct for translucent lines and may not work on certain platforms. As a workaround, install the Antialiased Line2D add-on then create an AntialiasedRegularPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing. 2D batching is also still supported with those antialiased lines.

public static void DrawArc(Vector2 center, float radius, float startAngle, float endAngle, int pointCount, float width)

Parameters

center Vector2

The central position of the arc.

radius float

The radius of the arc.

startAngle float

The angle at which the arc will be drawn.

endAngle float

The angle where the arc will finish being drawn.

pointCount int

The number of stitches used in the arc.

This parameter will define the visual aspect of the bow, whether it will have a smoother or more serrated curve.

width float

The thickness of the line.

DrawCircle(Vector2, float)

Draws a colored, filled circle. See also DrawArc(Vector2, float, float, float, int, Color, float, bool), DrawPolyline(Vector2[], Color, float, bool) and DrawPolygon(Vector2[], Color[], Vector2[], Texture, Texture, bool).

Note: Built-in antialiasing is not provided for DrawCircle(Vector2, float, Color). As a workaround, install the Antialiased Line2D add-on then create an AntialiasedRegularPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing.

public static void DrawCircle(Vector2 position, float radius)

Parameters

position Vector2

The central position of the circle.

radius float

The radius of the circle.

DrawLine(Vector2, Vector2)

Draws a line from a 2D point to another, with a given color and width. It can be optionally antialiased. See also DrawMultiline(Vector2[], Color, float, bool) and DrawPolyline(Vector2[], Color, float, bool).

Note: Line drawing is not accelerated by batching if antialiased is true.

Note: Due to how it works, built-in antialiasing will not look correct for translucent lines and may not work on certain platforms. As a workaround, install the Antialiased Line2D add-on then create an AntialiasedLine2D node. That node relies on a texture with custom mipmaps to perform antialiasing. 2D batching is also still supported with those antialiased lines.

public static void DrawLine(Vector2 start, Vector2 end)

Parameters

start Vector2

The beginning of the line.

end Vector2

The end of the line.

DrawLine(Vector2, Vector2, float)

Draws a line from a 2D point to another, with a given color and width. It can be optionally antialiased. See also DrawMultiline(Vector2[], Color, float, bool) and DrawPolyline(Vector2[], Color, float, bool).

Note: Line drawing is not accelerated by batching if antialiased is true.

Note: Due to how it works, built-in antialiasing will not look correct for translucent lines and may not work on certain platforms. As a workaround, install the Antialiased Line2D add-on then create an AntialiasedLine2D node. That node relies on a texture with custom mipmaps to perform antialiasing. 2D batching is also still supported with those antialiased lines.

public static void DrawLine(Vector2 start, Vector2 end, float width)

Parameters

start Vector2

The beginning of the line.

end Vector2

The end of the line.

width float

The thickness of the line.

DrawMesh(Mesh, Texture, Texture?, Transform2D?)

Draws a Godot.Mesh in 2D, using the provided texture. See Godot.MeshInstance2D for related documentation.

public static void DrawMesh(Mesh mesh, Texture texture, Texture? normalMap = null, Transform2D? transform = null)

Parameters

mesh Mesh

The mesh that will be used to shape the design.

texture Texture

The texture that will be used to draw on the mesh.

normalMap Texture

The texture normal map.

transform Transform2D?

If the parameter is null, then the default value is Transform2D.Identity

DrawMultiline(Vector2[])

Draws multiple disconnected lines with a uniform color. When drawing large amounts of lines, this is faster than using individual DrawLine(Vector2, Vector2, Color, float, bool) calls. To draw interconnected lines, use DrawPolyline(Vector2[], Color, float, bool) instead.

Note: width and antialiased are currently not implemented and have no effect. As a workaround, install the Antialiased Line2D add-on then create an AntialiasedLine2D node. That node relies on a texture with custom mipmaps to perform antialiasing. 2D batching is also still supported with those antialiased lines.

public static void DrawMultiline(Vector2[] points)

Parameters

points Vector2[]

The points that form the line.

DrawMultiline(Vector2[], float)

Draws multiple disconnected lines with a uniform color. When drawing large amounts of lines, this is faster than using individual DrawLine(Vector2, Vector2, Color, float, bool) calls. To draw interconnected lines, use DrawPolyline(Vector2[], Color, float, bool) instead.

Note: width and antialiased are currently not implemented and have no effect. As a workaround, install the Antialiased Line2D add-on then create an AntialiasedLine2D node. That node relies on a texture with custom mipmaps to perform antialiasing. 2D batching is also still supported with those antialiased lines.

public static void DrawMultiline(Vector2[] points, float width)

Parameters

points Vector2[]

The points that form the line.

width float

The thickness of the line.

DrawMultiline(List<Vector2>)

Draws multiple disconnected lines with a uniform color. When drawing large amounts of lines, this is faster than using individual DrawLine(Vector2, Vector2, Color, float, bool) calls. To draw interconnected lines, use DrawPolyline(Vector2[], Color, float, bool) instead.

Note: width and antialiased are currently not implemented and have no effect. As a workaround, install the Antialiased Line2D add-on then create an AntialiasedLine2D node. That node relies on a texture with custom mipmaps to perform antialiasing. 2D batching is also still supported with those antialiased lines.

public static void DrawMultiline(List<Vector2> points)

Parameters

points List<Vector2>

The points that form the line.

DrawMultiline(List<Vector2>, float)

Draws multiple disconnected lines with a uniform color. When drawing large amounts of lines, this is faster than using individual DrawLine(Vector2, Vector2, Color, float, bool) calls. To draw interconnected lines, use DrawPolyline(Vector2[], Color, float, bool) instead.

Note: width and antialiased are currently not implemented and have no effect. As a workaround, install the Antialiased Line2D add-on then create an AntialiasedLine2D node. That node relies on a texture with custom mipmaps to perform antialiasing. 2D batching is also still supported with those antialiased lines.

public static void DrawMultiline(List<Vector2> points, float width)

Parameters

points List<Vector2>

The points that form the line.

width float

The thickness of the line.

DrawRect(Rect2)

Draws a solid body rectangle.

Note: Due to how it works, built-in antialiasing will not look correct for translucent polygons and may not work on certain platforms. As a workaround, install the Antialiased Line2D add-on then create an AntialiasedPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing.

public static void DrawRect(Rect2 rect)

Parameters

rect Rect2

The dimensions of the rectangle.

DrawTexture(Texture, Vector2, Texture?)

Draws a texture at a given position.

public static void DrawTexture(Texture texture, Vector2 position, Texture? normalMap = null)

Parameters

texture Texture
position Vector2
normalMap Texture

DrawTextureRect(Texture, Rect2, bool, bool, Texture?)

Draws a textured rectangle at a given position, optionally modulated by a color. If transpose is true, the texture will have its X and Y coordinates swapped.

public static void DrawTextureRect(Texture texture, Rect2 rect, bool tile, bool transpose = false, Texture? normalMap = null)

Parameters

texture Texture
rect Rect2
tile bool
transpose bool
normalMap Texture

DrawWireRect(Rect2)

Draw a rectangle of a skeletonized body.

Note: Due to how it works, built-in antialiasing will not look correct for translucent polygons and may not work on certain platforms. As a workaround, install the Antialiased Line2D add-on then create an AntialiasedPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing.

public static void DrawWireRect(Rect2 rect)

Parameters

rect Rect2

The dimensions of the rectangle.

DrawWireRect(Rect2, float)

Draw a rectangle of a skeletonized body.

Note: Due to how it works, built-in antialiasing will not look correct for translucent polygons and may not work on certain platforms. As a workaround, install the Antialiased Line2D add-on then create an AntialiasedPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing.

public static void DrawWireRect(Rect2 rect, float width)

Parameters

rect Rect2

The dimensions of the rectangle.

width float

The thickness of the line.