Spine Runtimes

repository·4.3·Indexed 26 days ago

https://github.com/esotericsoftware/spine-runtimes

High-performance implementations of the Spine animation engine for various platforms, including C++, C#, Dart, Haxe, Java, and TypeScript. The repository includes specialized runtimes such as spine-ts (v4.3.13), spine-flutter, spine-android, and spine-c, along with a C API code generator and comprehensive source code formatting tools for all supported languages.

Tokens
64.6K
Snippets
111
Records
315
Agent score
88%

What's inside spine-runtimes

  1. Overview of spine-ts modules

    4.3

    The spine-ts runtime allows loading and manipulating Spine skeletal animation data using TypeScript and JavaScript. It is modularized into several backends and specialized modules:

    • @esotericsoftware/spine-core: Core classes for loading and processing Spine skeletons.
    • @esotericsoftware/spine-webgl: A self-contained WebGL backend.
    • @esotericsoftware/spine-canvas: A self-contained Canvas backend.
    • @esotericsoftware/spine-canvaskit: A self-contained CanvasKit backend (supports NodeJS for headless rendering and browsers).
    • @esotericsoftware/spine-player: A self-contained player for easy website display (built on core and WebGL).
    • @esotericsoftware/spine-webcomponents: Web components for easy website display.
    • @esotericsoftware/spine-threejs: A THREE.JS backend.
    • @esotericsoftware/spine-phaser-v3 & @esotericsoftware/spine-phaser-v4: Phaser backends.
    • @esotericsoftware/spine-pixi-v7 & @esotericsoftware/spine-pixi-v8: PixiJS backends.
    • @esotericsoftware/spine-construct3: Official Construct 3 plugin (distributed as a .c3addon).
  2. Overview of Spine Runtimes

    4.3
    Spine Runtimes provides multi-language libraries for Spine 2D skeletal animations. It includes core runtimes for various programming languages and specialized integration runtimes for game engines and frameworks. The system supports advanced features like Inverse Kinematics (IK), path constraints, physics constraints, and animation layering.
  3. Overview of spine-godot runtime

    4.3

    The spine-godot runtime allows you to load, manipulate, and render Spine skeletal animation data within the Godot engine. It is based on spine-cpp and provides compatibility for different Godot versions.

    Supported Godot Versions:

    • Godot 3.5.x
    • Godot 4.0.x

    Spine Version Compatibility:

    • Works with data exported from Spine 4.3.xx.

    Feature Limitations:

    • Does not support two-color tinting.
    • Does not support the screen blend mode.
  4. Overview of spine-c runtime

    4.3

    The spine-c runtime provides basic functionality to load and manipulate Spine skeletal animation data using C. It is a C wrapper around spine-cpp designed for environments that cannot easily interact with C++ code.

    Key features:

    • SkeletonRenderer: A generic renderer that returns render commands. These commands can be used with any rendering API that supports textured triangle meshes with blend modes.
    • Compatibility: Works with data exported from Spine 4.3.xx and supports all Spine features.

    For implementation examples, refer to spine-glfw, spine-sdl, or spine-sfml in the repository.

  5. Overview of spine-cpp

    4.3

    spine-cpp is a C++ runtime that provides the core functionality required to load and manipulate Spine skeletal animation data.

    Key Characteristics:

    • No Rendering: It does not perform rendering itself. It is designed to be extended by integrating it with a rendering engine or framework.
    • Compatibility: It works with data exported from Spine 4.3.xx.
    • Feature Support: It supports all Spine features.
    • Extensibility: It can be used as a base for other runtimes (e.g., GLFW, SDL, SFML, Godot, Unreal Engine).
  6. Understand Haxe Runtime Package Organization

    4.3

    The Haxe runtime is organized into several functional directories under spine/. Developers should navigate these packages based on the specific Spine feature they are implementing or using:

    • Core Classes: Contains fundamental data and instance classes like Skeleton.hx, SkeletonData.hx, Bone.hx, BoneData.hx, Slot.hx, and SlotData.hx.
    • Animation System: Located in the animation/ directory; includes Animation.hx, AnimationState.hx, and related logic.
    • Attachments: Located in the attachments/ directory; contains various attachment type implementations.
    • Atlas System: Located in the atlas/ directory; handles texture atlas management.
    • Framework Integrations: Contains subdirectories for specific rendering frameworks, such as flixel/ and starling/.
  7. Understand the spine-c Codegen System Architecture

    4.3

    The spine-c codegen system is a TypeScript-based pipeline designed to automatically create a C wrapper API for the Spine C++ runtime. This system is used as the foundation for generating multi-language bindings (such as Swift, Dart, or Java) by first converting C++ headers into a structured Intermediate Representation (IR).

    Pipeline Stages

    1. Type Extraction: Parses C++ headers using Clang's -ast-dump=json.
    2. Type Processing: Filters and validates extracted types.
    3. Validation: Checks for conflicts (e.g., const/non-const method conflicts) and unsupported patterns.
    4. Array Scanning: Detects and generates specialized array types.
    5. IR Generation: Converts C++ types into a C intermediate representation.
    6. Code Writing: Generates the final header and implementation files.
    7. Inheritance Analysis: Builds inheritance maps to support language-specific binding requirements.
  8. Understand the spine-flutter Architecture

    4.3

    The spine-flutter runtime uses a multi-layer architecture to provide a native Dart experience for Spine animations:

    1. spine-cpp: The core C++ implementation.
    2. spine-c: A C wrapper API around spine-cpp.
    3. FFI bindings: Low-level Dart FFI bindings to spine-c (generated via ffigen).
    4. Dart wrappers: Idiomatic, type-safe Dart classes that provide the high-level API for Flutter developers.

    This architecture ensures that while the heavy lifting is done in C++, developers interact with clean, type-safe Dart code.