# 🔌 Porting a Player

Want to run SpriteStudio animations on an engine or platform that doesn't have an official player yet? **SpriteStudio-SDK ships a full Player Porting Guide** that walks you through building one on top of `libssruntime`.

> [!TIP]
>
> **Where the guide lives**
>
> The canonical guide is published on the SDK's documentation site: [**SpriteStudio Player Porting Guide**](<https://cri-middleware.github.io/SpriteStudio-SDK/>) (source: [`libs/ssruntime/docs/`](<https://github.com/cri-middleware/SpriteStudio-SDK/tree/HEAD/libs/ssruntime/docs>) in the SDK repository). This page is a map into it - the SDK is the source of truth.

## 🧠 Core idea: Brain vs. Body

`libssruntime` is the **Brain** - it does all the animation computation (state, transforms, mesh/deform, batching plan) and is engine-agnostic. Your player provides the **Body** - the engine-specific loading, drawing, event notification and sound playback. Porting is mostly about wiring your engine's Body to the shared Brain.

## 📋 What the guide covers

| Section | Contents |
| --- | --- |
| **10\. Introduction** | Overview of the Brain / Player split, **Limitations** (technical constraints - read first), and the glossary. |
| **20\. Design** | Preparation, the Player's design (ssab memory, class structure, coordinate systems), the **Player API conventions** every Player shares, and `no_std` integration. |
| **30\. Basic playback** | Loading & initialization, playback control, events, and the render loop (the DrawBatch plan). |
| **40\. Parts** | Parts color, mesh, 9-slice / shape / text, mask, instance parts, effect parts. |
| **50\. Features** | Animation mixing, part overrides, external resources & textures, sequence, audio, editor integration, placement (fit and align), UI integration (hit testing, UI states, reduced motion). |
| **60\. Troubleshooting** | A table from symptom to cause, and link errors. |

> [!NOTE]
>
> **Verify as you go**
>
> The guide recommends checking each stage against the animations in [`tests/overall/overall.sspj`](<https://github.com/cri-middleware/SpriteStudio-SDK/blob/HEAD/tests/overall/overall.sspj>) from the SDK repository - if they match the SpriteStudio editor, that step is done. Every official player is built this way, so any of them makes a good reference - see [Choose Your Platform](<https://cri-middleware.github.io/SpriteStudio-Docs/overview/choose-your-platform/index.md>) for the current lineup.

## 🚦 Before you start

- Read [SDK Concepts](<https://cri-middleware.github.io/SpriteStudio-Docs/sdk/concepts/index.md>) for the convert -\> runtime pipeline, and keep the [Glossary](<https://cri-middleware.github.io/SpriteStudio-Docs/sdk/glossary/index.md>) open for the terms the guide assumes.
- Read the guide's **[Limitations](<https://github.com/cri-middleware/SpriteStudio-SDK/blob/HEAD/libs/ssruntime/docs/10_introduction/20_limitations.md>)** and **[Player API Conventions](<https://github.com/cri-middleware/SpriteStudio-SDK/blob/HEAD/libs/ssruntime/docs/20_design/30_api_conventions.md>)** first - both shape your player's design.
- Get the libraries from the SDK's [Releases](<https://github.com/cri-middleware/SpriteStudio-SDK/releases>): `spritestudio-sdk-static-libs.zip` or `spritestudio-sdk-dynamic-libs.zip` (`libssruntime`, `libssconverter`, the C headers and the C\# bindings) and `spritestudio-sdk-web-libs.zip` for the browser. The Rust API is in the [rustdoc](<https://cri-middleware.github.io/SpriteStudio-SDK/api/ssruntime/index.html>).
- Source & issues: [SpriteStudio-SDK](<https://github.com/cri-middleware/SpriteStudio-SDK>).
