Skip to content

API reference ​

The generated reference lists every exported symbol. This page is the map that goes with it: which class to start from, what sits underneath it, and which types you actually touch.

Start from one class ​

You only ever construct one player class — the one belonging to the renderer package you installed. Everything else hangs off it.

Your setupClassPackage
Frameworkless / drop-inSSSurface, whose createPlayer() returns an SSPlayerssplayer-webgl
Plain HTML, no JS wiring<ss-player> (see WebGL & Web Components)ssplayer-webgl
PixiJS v8 appSSPlayerssplayer-pixi
A button in a PixiJS v8 app (see UI buttons)SSButtonssplayer-pixi-ui
Your own rendererDirectInternalPlayer + GeometryBuilderssplayer-core

The WASM runtime is a module-level singleton, so initialize it once before creating any player:

ts
await SSSurface.initialize();  // WebGL; on PixiJS: await SSPlayer.initialize();

The same symbol appears four times

Each renderer package re-exports ssplayer-core, and ssplayer-pixi-ui re-exports ssplayer-pixi, so SSRuntimeManager, IResourceManager, BlendType and friends show up under all four package pages in the generated reference. They are the same declarations. Import from the package you installed — never add ssplayer-core alongside a renderer just to reach a core type.

What sits underneath ​

Useful when a stack trace or an autocomplete list drops you somewhere unfamiliar:

SSPlayer (webgl) / SSPlayer (pixi) ← the facade you call (playback, events, overrides)
  └─ DirectInternalPlayer          ← extends InternalPlayerBase; owns loading + the draw plan
       └─ SSRuntimeManager         ← the WASM boundary; frame data as zero-copy typed-array views
            └─ SSRuntimeContext    ← wasm-bindgen handle (generated; you should not need it)

Each layer is public, but the further down you go the more the contract is "whatever the runtime currently emits". Stay on the facade unless you are writing a renderer.

Types you will actually touch ​

Events — see Events & user data. SSUserDataEvent, SSSignalEvent, SSAudioEvent, and Unsubscribe — the handle every onX method returns.

Part overrides — see Part control. SSBlendOp, SSOverridePriority, SSPartOverrideTarget.

Texture replacement — see Runtime texture replacement. setCellmapTexture / getReplaceableTextureNames live on SSPlayer; each takes its engine's own texture object (no dedicated type to import).

Part tracking — see Part tracking. SSPartFollowOptions, SSDecomposedTransform, and on PixiJS also SSPartAttachment.

Motion blending — see Motion blending. SSTrackBlend and SSTrackSync, what setTrackBlend and setTrackSync take. Sources are plain number handles.

Playback enums.WebPlaybackDirection and WebPlaybackStyle are the two arguments to setPlaybackDirection.

Construction options (WebGL only) — SSSurfaceOptions covers backgroundColor, maxDPR, antialias, pauseWhenHidden and the rest. See Performance tuning.

Interfaces you implement ​

These are the extension points — the player calls you.

InterfaceImplement it when
IAudioManagerYou want the animation's sounds played by your own audio engine. @spritestudio/ssplayer-core ships a ready-made SSWebAudioManager (its /audio subpath) you can use instead.
IResourceManagerYou are writing a renderer, or you need textures to come from somewhere other than sibling files. See Resources & lifecycle.
InstancePackProviderInstance parts reference packs that are not URL-addressable (in-memory bundles, drag-and-drop).

Conversion API ​

@spritestudio/ssconverter-core is a separate, player-independent surface — convertProject, locateProject and ConvertOptions. See Preparing assets.


Everything else, in full: generated API reference.