Skip to content

Interface: SSSurfaceOptions ​

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

Properties ​

antialias? ​

optional antialias?: boolean

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


autoStart? ​

optional autoStart?: boolean

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


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.


flipY? ​

optional flipY?: boolean

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

Invert the vertical axis. Needed for borrowed contexts whose framebuffer Y convention is opposite a standalone canvas's default framebuffer — RPG Maker MZ's shared context, where SS otherwise draws upside-down. Owned surfaces leave this off.


maxDPR? ​

optional maxDPR?: number

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


pauseWhenHidden? ​

optional pauseWhenHidden?: boolean

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


powerPreference? ​

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

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


premultipliedAlpha? ​

optional premultipliedAlpha?: boolean

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


stencil? ​

optional stencil?: boolean

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