mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Draw an outline for 2D debug collision shapes
This makes them easier to distinguish, especially when used in a TileMap. The default color's opacity has been slightly decreased to account for the new outline.
This commit is contained in:
parent
4b9b9ed2f2
commit
aacaad5066
5 changed files with 26 additions and 1 deletions
|
|
@ -81,6 +81,9 @@ void CircleShape2D::draw(const RID &p_to_rid, const Color &p_color) {
|
|||
Vector<Color> col;
|
||||
col.push_back(p_color);
|
||||
VisualServer::get_singleton()->canvas_item_add_polygon(p_to_rid, points, col);
|
||||
VisualServer::get_singleton()->canvas_item_add_polyline(p_to_rid, points, col, 1.0, true);
|
||||
// Draw the last segment as it's not drawn by `canvas_item_add_polyline()`.
|
||||
VisualServer::get_singleton()->canvas_item_add_line(p_to_rid, points[points.size() - 1], points[0], p_color, 1.0, true);
|
||||
}
|
||||
|
||||
CircleShape2D::CircleShape2D() :
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue