---
url: https://cri-middleware.github.io/SSPlayerForWeb/api/@spritestudio/ssplayer-webgl/interfaces/SSOverlayOptions.md
---
# Interface: SSOverlayOptions

Defined in: [ssplayer-webgl/src/SSOverlay.ts:4](https://github.com/cri-middleware/SSPlayerForWeb/blob/eb9d544908210befb40d3729ed6fde7adc44f61a/packages/ssplayer-webgl/src/SSOverlay.ts#L4)

## Extends

* `Omit`<[`SSSurfaceOptions`](SSSurfaceOptions.md), `"autoStart"` | `"flipY"`>

## Properties

### antialias?

> `optional` **antialias?**: `boolean`

Defined in: [ssplayer-webgl/src/SSSurface.ts:10](https://github.com/cri-middleware/SSPlayerForWeb/blob/eb9d544908210befb40d3729ed6fde7adc44f61a/packages/ssplayer-webgl/src/SSSurface.ts#L10)

#### Inherited from

[`SSSurfaceOptions`](SSSurfaceOptions.md).[`antialias`](SSSurfaceOptions.md#antialias)

***

### backgroundColor?

> `optional` **backgroundColor?**: `number`

Defined in: [ssplayer-webgl/src/SSSurface.ts:30](https://github.com/cri-middleware/SSPlayerForWeb/blob/eb9d544908210befb40d3729ed6fde7adc44f61a/packages/ssplayer-webgl/src/SSSurface.ts#L30)

Opaque backdrop colour (0xRRGGBB) to clear each frame to. When omitted the
surface is cleared TRANSPARENT (0,0,0,0) for overlay use.

Set this when an animation uses additive / backdrop-reading blend modes
(Add, Screen, Mul, …): those composite against the framebuffer, so they are
only correct when a real opaque backdrop is present. On a transparent surface
an additive sprite whose texture is a glow baked on an opaque black background
renders that black as an opaque block (it has nothing to add onto). This is
inherent to premultiplied-alpha compositing — ssplayer-pixi avoids it the same
way, by rendering on an opaque `backgroundColor`.

For a single player that needs its own backdrop on a shared surface, use
[SSPlayer.backdrop](../classes/SSPlayer.md#backdrop) instead.

#### Inherited from

[`SSSurfaceOptions`](SSSurfaceOptions.md).[`backgroundColor`](SSSurfaceOptions.md#backgroundcolor)

***

### container?

> `optional` **container?**: `HTMLElement`

Defined in: [ssplayer-webgl/src/SSOverlay.ts:25](https://github.com/cri-middleware/SSPlayerForWeb/blob/eb9d544908210befb40d3729ed6fde7adc44f61a/packages/ssplayer-webgl/src/SSOverlay.ts#L25)

Where to mount the overlay canvas. Defaults to `document.body`, which makes
it viewport-sized. Pass a positioned element to scope an overlay to a
scroll container instead — note that costs another WebGL context.

***

### followOpacity?

> `optional` **followOpacity?**: `boolean`

Defined in: [ssplayer-webgl/src/SSOverlay.ts:19](https://github.com/cri-middleware/SSPlayerForWeb/blob/eb9d544908210befb40d3729ed6fde7adc44f61a/packages/ssplayer-webgl/src/SSOverlay.ts#L19)

Also read each host element's computed `opacity` into its player's alpha
(default off).

Off, an element is only a position. On, it is a position *and* a fade — which
is what lets a host engine keep animating these elements with its own tooling
and have the animation follow. `ssplayer-tyranoscript` turns it on so
TyranoScript's `[anim opacity=]` / `[kanim]` still fade an SS character after
the character stopped being a canvas.

Costs a `getComputedStyle` per tracked element per frame, so it is opt-in.

***

### maxDPR?

> `optional` **maxDPR?**: `number`

Defined in: [ssplayer-webgl/src/SSSurface.ts:11](https://github.com/cri-middleware/SSPlayerForWeb/blob/eb9d544908210befb40d3729ed6fde7adc44f61a/packages/ssplayer-webgl/src/SSSurface.ts#L11)

#### Inherited from

[`SSSurfaceOptions`](SSSurfaceOptions.md).[`maxDPR`](SSSurfaceOptions.md#maxdpr)

***

### pauseWhenHidden?

> `optional` **pauseWhenHidden?**: `boolean`

Defined in: [ssplayer-webgl/src/SSSurface.ts:13](https://github.com/cri-middleware/SSPlayerForWeb/blob/eb9d544908210befb40d3729ed6fde7adc44f61a/packages/ssplayer-webgl/src/SSSurface.ts#L13)

#### Inherited from

[`SSSurfaceOptions`](SSSurfaceOptions.md).[`pauseWhenHidden`](SSSurfaceOptions.md#pausewhenhidden)

***

### powerPreference?

> `optional` **powerPreference?**: `"default"` | `"low-power"` | `"high-performance"`

Defined in: [ssplayer-webgl/src/SSSurface.ts:12](https://github.com/cri-middleware/SSPlayerForWeb/blob/eb9d544908210befb40d3729ed6fde7adc44f61a/packages/ssplayer-webgl/src/SSSurface.ts#L12)

#### Inherited from

[`SSSurfaceOptions`](SSSurfaceOptions.md).[`powerPreference`](SSSurfaceOptions.md#powerpreference)

***

### premultipliedAlpha?

> `optional` **premultipliedAlpha?**: `boolean`

Defined in: [ssplayer-webgl/src/SSSurface.ts:8](https://github.com/cri-middleware/SSPlayerForWeb/blob/eb9d544908210befb40d3729ed6fde7adc44f61a/packages/ssplayer-webgl/src/SSSurface.ts#L8)

#### Inherited from

[`SSSurfaceOptions`](SSSurfaceOptions.md).[`premultipliedAlpha`](SSSurfaceOptions.md#premultipliedalpha)

***

### stencil?

> `optional` **stencil?**: `boolean`

Defined in: [ssplayer-webgl/src/SSSurface.ts:9](https://github.com/cri-middleware/SSPlayerForWeb/blob/eb9d544908210befb40d3729ed6fde7adc44f61a/packages/ssplayer-webgl/src/SSSurface.ts#L9)

#### Inherited from

[`SSSurfaceOptions`](SSSurfaceOptions.md).[`stencil`](SSSurfaceOptions.md#stencil)

***

### zIndex?

> `optional` **zIndex?**: `number`

Defined in: [ssplayer-webgl/src/SSOverlay.ts:6](https://github.com/cri-middleware/SSPlayerForWeb/blob/eb9d544908210befb40d3729ed6fde7adc44f61a/packages/ssplayer-webgl/src/SSOverlay.ts#L6)

Stacking order of the overlay canvas. Default 0 — behind positioned UI.
