# DrawShapes(ReadOnlySpan<PhysicsShape>)

> Draw a batch of shapes once, as custom drawing, each drawn into the world it belongs to.

## Definition

* **Type:** Method
* **Namespace:** [Unity.U2D.Physics](/engine/6000.7/script-reference/unity/u2d/physics.md)
* **Assembly:** UnityEngine.PhysicsCore2DModule

```csharp
public static int DrawShapes(ReadOnlySpan<PhysicsShape> shapes)
```

### Parameters

**** (\[ReadOnlySpan\<PhysicsShape>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The shapes to draw.

### Returns

| Type                                                       | Description                                                                                                                        |
| ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The number of shapes that were ignored (not drawn because the shape was invalid). A single warning is logged when any are ignored. |

### Remarks

The shapes can belong to different worlds; the world of each shape is locked only when it changes across the batch, so shapes should be ordered by world for the fewest locks. Any invalid shape in the batch is ignored. Unlike [\_selectedDrawing](/engine/6000.7/script-reference/unity/u2d/physics/physicsshape/selecteddrawing.md), this does not persist: it draws once and is gone once every Scene/Game view has painted. See [PhysicsShape.Draw](/engine/6000.7/script-reference/unity/u2d/physics/physicsshape/draw.md) for drawing a single shape.
