Material Box

Material Box

WEB Design & Material Images

Godot - Draw rectangle

Godot

GDScript code example to draw rectangle.


It is possible to draw rectangles from script using draw_rect().
With draw_rect(), specify coordinates, size, color and transparency of shape.

# draw_rect(Rect2(x, y, width, height), Color(color, transparency))

func _draw():
	draw_rect(Rect2(0, 0, 250, 250), Color('#000000', 0.5))

Godot

TitleGodot - Draw rectangle

CategoryGodot

Created

Update

AuthorYousuke.U