Click or drag to resize

CanvasItemDrawRect Method

Draws a rectangle. If filled is true, the rectangle will be filled with the color specified. If filled is false, the rectangle will be drawn as a stroke with the color and width specified. If antialiased is true, the lines will be antialiased.

Note: width and antialiased are only effective if filled is false.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public void DrawRect(
	Rect2 rect,
	Color color,
	bool filled = true,
	float width = 1f,
	bool antialiased = false
)

Parameters

rect
Type: GodotRect2

[Missing <param name="rect"/> documentation for "M:Godot.CanvasItem.DrawRect(Godot.Rect2,Godot.Color,System.Boolean,System.Single,System.Boolean)"]

color
Type: GodotColor

[Missing <param name="color"/> documentation for "M:Godot.CanvasItem.DrawRect(Godot.Rect2,Godot.Color,System.Boolean,System.Single,System.Boolean)"]

filled (Optional)
Type: SystemBoolean

[Missing <param name="filled"/> documentation for "M:Godot.CanvasItem.DrawRect(Godot.Rect2,Godot.Color,System.Boolean,System.Single,System.Boolean)"]

width (Optional)
Type: SystemSingle

[Missing <param name="width"/> documentation for "M:Godot.CanvasItem.DrawRect(Godot.Rect2,Godot.Color,System.Boolean,System.Single,System.Boolean)"]

antialiased (Optional)
Type: SystemBoolean

[Missing <param name="antialiased"/> documentation for "M:Godot.CanvasItem.DrawRect(Godot.Rect2,Godot.Color,System.Boolean,System.Single,System.Boolean)"]

See Also