Skip to content

SpriteStudio Player Porting Guide

This guide explains how to implement a SpriteStudio Player for any game engine or platform using libssruntime (the Brain). The Brain computes the animation state, and the Player loads the ssab, draws, notifies events and plays sounds (Overview).

Every page of this guide is available in English, and each page has a Japanese source: the language selector in the site's header switches to it, and on GitHub each page links to it at the top. The Japanese version is the source of truth. If the two disagree, follow the Japanese page and report the discrepancy.

  • Read first: Limitations and Player API Conventions. Both shape the design of your Player.
  • How the pages are written: Each page begins by stating what the Player does on that page. "Do โ€ฆ" and "Do not โ€ฆ" mark what you must follow; "We recommend โ€ฆ" marks what you may choose. Terms are used in the sense given in the Glossary.
  • Code examples: They are written in C++ that calls the C-API. Where an example uses a function that does not exist (such as the engine's drawing routine), the example says so next to it.

1. Implementation steps

The SDK's tests/overall/overall.sspj contains an animation for each feature. Implement in the order below, and at each stage compare whether it looks the same as in the SpriteStudio editor. When it does, that stage is done.

Stage Animation to check What to check Pages to read
0. Preparation โ€” The build passes, and you can read animation names from the ssab Preliminary Checks, Design Approach, Loading and Initialization ยง5
1. Basic drawing Basic.ssae Children follow the parent's movement, rotation and scaling. Lowering the parent's opacity also fades the children Loading and Initialization, Playback Control, Render Loop
2. Blending and color BlendMode.ssae, PartsColor.ssae Additive and multiply blending composite correctly over the background. Tinting of the whole part and per vertex matches Parts Color
3. Structure and deformation Mesh.ssae, Instance.ssae, Mask.ssae Mesh deformation and bone following are smooth. Child animations play. Only the area inside the mask is shown Mesh, Instance Parts, Mask
4. Integration with the game UserData.ssae, Signal.ssae Events arrive on the expected frames Events
5. Effects Effect.ssae Particles scatter and fade out over time Effect Parts
6. As needed NineSlice.ssae, Shape.ssae, Text.ssae, Sound.ssae, TextureChange.ssae, InstancePropagation.ssae The 9-slice corners are preserved when scaled up. Shapes and text appear. Sounds play on the expected frames. With texture change, two parts are drawn with different textures. A mask inside a child animation takes effect in the parent 9-Slice, Shape, and Text, Audio, External Resources and Textures, Mask ยง2-7

2. Contents

10. Introduction

Page Contents
Overview The division of work between Brain and Player, the audience, how to read the code examples
Limitations Technical constraints that affect Player design. Read before implementing
Glossary The terms used in this guide

20. Design

Page Contents
Preliminary Checks and Project Setup Checking whether the Brain can be used on your target engine, and preparing an empty project
Player Design Approach How to integrate the library, ssab memory, class structure, drawing approach, coordinate systems
Player API Conventions The names, argument order, events, defaults and failure reporting that every Player shares. Read before writing your public API
Integrating into no_std Environments Building it yourself, and using the engine's allocator

30. Basic playback

Page Contents
Loading and Initialization Resources and Contexts, ssab validation, loading textures, logging and errors
Playback Control The flow of one frame, playback state, speed, sub-frames, detecting loops and the end
Events How to read user data, signal and audio events
Render Loop SoA buffers, drawing with DrawBatch, RenderMode, performance

40. Parts

Page Contents
Parts Color Compositing vertex colors with the texture, shader examples
Mesh How to read the deformed vertices
9-Slice, Shape, and Text How to read their dedicated buffers, and the text layout specification
Mask The rules that decide masking and clipping, and implementations with the stencil and a coverage bitmap
Instance Parts Preparing, advancing and drawing child animations; independent playback
Effect Parts Advancing and drawing particles

50. Features

Page Contents
Animation Mixing Stacking animations on tracks to overlay, switch and blend them
Part Overrides Overriding a part's color, cell and visibility at runtime
External Resources and Textures Replacing textures, and referencing another ssab
Sequence Playing several animations in order
Audio When to play a sound, and how long a sound lives
Editor Integration Converting sspj in the engine's editor
Placement: Fit and Align Fitting the animation into a box the host laid out
UI Integration: Hit Testing, UI States and Reduced Motion Making the animation a UI component, such as a button

60. Troubleshooting

Page Contents
Troubleshooting A table that leads from symptoms to causes, and link errors

SpriteStudio-SDK / libssruntime