# Sandbox.Texture.CreateRenderTarget

## Overload 1

```csharp
static TextureBuilder CreateRenderTarget()
```

Begins creation of a render target. Finish by calling `M:Sandbox.TextureBuilder.Create(System.String,System.Boolean,System.ReadOnlySpan{System.Byte},System.Int32)`.

### Returns

`TextureBuilder`: The texture builder to help build the render target.

## Overload 2

```csharp
static Texture CreateRenderTarget(string name, ImageFormat format, Vector2 size)
```

A convenience function to quickly create a render target.

### Parameters

- `name` (`string`): A meaningless debug name for your texture.
- `format` (`ImageFormat`): The image format.
- `size` (`Vector2`): The size of the texture.

### Returns

`Texture`: The newly created render target texture.

## Overload 3

```csharp
static Texture CreateRenderTarget(string name, ImageFormat format, Vector2 size, Texture oldTexture = null)
```

This will create a render target texture if `oldTexture` is null or doesn't match what you've passed in. This is designed
to be called regularly to resize your texture in response to other things changing (like the screen size, panel size etc).

### Parameters

- `name` (`string`): A meaningless debug name for your texture.
- `format` (`ImageFormat`): The image format.
- `size` (`Vector2`): The size of the texture.
- `oldTexture` (`Texture`), default `null`: A previously created texture.

### Returns

`Texture`: Will return a new texture, or the `oldTexture`.

Declared in [Sandbox.Texture](/api/Sandbox.Texture).
Assembly: `Sandbox.Engine`.
