# Class: RenderTarget

Defined in: [target.ts:23](https://github.com/debuffjp/debuff/blob/8c63a41ceef99b44f44b783b35121cc928cd37d7/packages/spryte/src/target.ts#L23)

An offscreen image you draw into with `draw.into(target, fn)` and then draw like any image:
post-processing, cached static layers, minimaps, trails. Size is in pixels.

On WebGL2 the contents live on the GPU and are lost if the context is lost: redraw them when
`draw.contextLost` turns false again, or redraw every frame.

## Constructors

### Constructor

> **new RenderTarget**(`width`, `height`, `format?`): `RenderTarget`

Defined in: [target.ts:24](https://github.com/debuffjp/debuff/blob/8c63a41ceef99b44f44b783b35121cc928cd37d7/packages/spryte/src/target.ts#L24)

#### Parameters

##### width

`number`

##### height

`number`

##### format?

[`TargetFormat`](../type-aliases/TargetFormat.md) = `"rgba8"`

The storage this target really has, after any fallback.

#### Returns

`RenderTarget`

## Properties

### format

> `readonly` **format**: [`TargetFormat`](../type-aliases/TargetFormat.md) = `"rgba8"`

Defined in: [target.ts:28](https://github.com/debuffjp/debuff/blob/8c63a41ceef99b44f44b783b35121cc928cd37d7/packages/spryte/src/target.ts#L28)

The storage this target really has, after any fallback.

***

### height

> `readonly` **height**: `number`

Defined in: [target.ts:26](https://github.com/debuffjp/debuff/blob/8c63a41ceef99b44f44b783b35121cc928cd37d7/packages/spryte/src/target.ts#L26)

***

### width

> `readonly` **width**: `number`

Defined in: [target.ts:25](https://github.com/debuffjp/debuff/blob/8c63a41ceef99b44f44b783b35121cc928cd37d7/packages/spryte/src/target.ts#L25)
