godot
godot copied to clipboard
Add antialiased, draw outline and line color/width properties to ColorRect
- Follow-up to https://github.com/godotengine/godot/pull/84523.
This exposes recently-added CanvasItem functionality to the ColorRect node, so that custom drawing methods don't need to be called if you want to benefit from antialiasing or non-filled rects.
The outline is drawn on top of the background, which can also now be disabled.
A similar approach could be used to expose functionality such as drawing circles and regular polygons, although this may make more sense as an extension of the Polygon2D node instead (since ColorRect is all about rectangles).
- This closes https://github.com/godotengine/godot/issues/91947.
Testing project: test_color_rect.zip