Skip to content

Interface: SSOverlayOptions ​

Defined in: ssplayer-webgl/src/SSOverlay.ts:4

Extends ​

Properties ​

antialias? ​

optional antialias?: boolean

Defined in: ssplayer-webgl/src/SSSurface.ts:10

Inherited from ​

SSSurfaceOptions.antialias


backgroundColor? ​

optional backgroundColor?: number

Defined in: ssplayer-webgl/src/SSSurface.ts:30

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 instead.

Inherited from ​

SSSurfaceOptions.backgroundColor


container? ​

optional container?: HTMLElement

Defined in: ssplayer-webgl/src/SSOverlay.ts:25

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

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

Inherited from ​

SSSurfaceOptions.maxDPR


pauseWhenHidden? ​

optional pauseWhenHidden?: boolean

Defined in: ssplayer-webgl/src/SSSurface.ts:13

Inherited from ​

SSSurfaceOptions.pauseWhenHidden


powerPreference? ​

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

Defined in: ssplayer-webgl/src/SSSurface.ts:12

Inherited from ​

SSSurfaceOptions.powerPreference


premultipliedAlpha? ​

optional premultipliedAlpha?: boolean

Defined in: ssplayer-webgl/src/SSSurface.ts:8

Inherited from ​

SSSurfaceOptions.premultipliedAlpha


stencil? ​

optional stencil?: boolean

Defined in: ssplayer-webgl/src/SSSurface.ts:9

Inherited from ​

SSSurfaceOptions.stencil


zIndex? ​

optional zIndex?: number

Defined in: ssplayer-webgl/src/SSOverlay.ts:6

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