Spine runtime for Rust (and wasm!) transpiled from the official C Runtime.

Overview

rusty_spine

Spine runtime for Rust (and wasm!) transpiled from the official C Runtime. Supports Spine 4.1.

[dependencies]
rusty_spine = "0.4.0"

Online demo!

Rust API

A Rust API is provided on top of the C API, because working with C APIs directly in Rust is tedious and error prone. It's made to be as thin a wrapper as possible.

The Rust API is unstable and changes often. Most features are accessible through rust with the most noteable exclusion being the Timeline API and custom attachment loaders. Most projects do not need these APIs, but if your's does, please open an issue.

Rust API Documentation

C API

If you wish to use the C API directly (either because the Rust API lacks a feature or for performance reasons), it is available under the rusty_spine::c import. See the C example.

C API Documentation

Engine Integrations

License

Because this project uses the official Spine Runtime, you must follow the Spine Runtimes License Agreement. If using the libc crate (via the use_libc feature), then see the libc crate for licensing. If using the built-in (wasm compatible) libc implementation, you must follow the BSD 3-clause license of The Regents of the University of California. See the LICENSE file for complete licenses. The Rust code is licensed under dual MIT / Apache-2.0 but with no attribution necessary. All contributions must agree to this licensing.

Features

use_libc

Default: no

A small subset of libc is provided in this repo to avoid a dependency on libc and to allow the code to run in the wasm32-unknown-unknown target. However, it's possible to rely on the OS implementation of libc instead by using the use_libc feature.

draw_functions

Default: yes

Provides helper functions for generating mesh data, as well as the SkeletonController helper struct.

egui_debugger

Default: no

Provides an egui debugger window for viewing skeleton and animation state. See it in action by running the bevy example with this feature enabled:

cargo run --release --example bevy --features egui_debugger

mint

Default: yes

Provides additional math functions using mint.

You might also like...
Rust based WASM/JS bindings for ur-rust

ur-wasm-js WASM/JS bindings for the ur-rust rust library Getting started Installation Either build the library yourself with wasm-pack or install for

πŸ“¦βœ¨ your favorite rust -> wasm workflow tool!
πŸ“¦βœ¨ your favorite rust - wasm workflow tool!

πŸ“¦ ✨ wasm-pack Your favorite Rust β†’ Wasm workflow tool! Docs | Contributing | Chat Built with πŸ¦€ πŸ•Έ by The Rust and WebAssembly Working Group About Th

Gun port in rust & wasm

gun-rs-wasm Rust & WASM port of Gun. For a non-wasm version, check out gun-rs Example (source) Use npm install rusty-gun import { Node as Gun } from "

πŸ“ A template for creating WASM + Typescript + Rust workflow libraries.
πŸ“ A template for creating WASM + Typescript + Rust workflow libraries.

Create Rust + TypeScript libraries with ease! PR'S WELCOMED! ✨ Inspiration I wanted to create a WebAssembly/Rust library with additional JS features,

A self-guided learning project that includes Rust + Wasm together
A self-guided learning project that includes Rust + Wasm together

A self-guided learning project that includes Rust + Wasm together. Who knows, maybe Typescript and React joins too..

Realtime audio processing / synthesis using Rust/WASM in the browser.
Realtime audio processing / synthesis using Rust/WASM in the browser.

Rust Audio About This repo is my investigation into using Rust for creative audio coding on various platforms (e.g. desktop, web, etc.), but especiall

Rust bindings for the Wasm spec interpreter.

wasm-spec-interpreter This project shows how to use ocaml-interop to call into the Wasm spec interpreter. There are several steps to making this work:

Simple devcontainer for Rust + WASM development

Devcontainer WASM-Rust Simple devcontainer for Rust development Usage Github Codespaces Just click the button: Visual Studio Code Note this assumes th

Create WASM plugins easily in Rust.

Scotch Library for creating WASM plugins with Rust. Scotch allows you to pass complex types to/from functions in WASM plugins. It achieves that by enc

Comments
  • Add support for Spine 3.8

    Add support for Spine 3.8

    Amazing project - transpiling the C runtimes is genius mad science. I've added support for Spine 3.8 but I have a few open questions:

    • Are you interested in Spine 3.8 support?
    • I added a spine38 feature and used #[cfg] for the few API changes - does this seem reasonable, or would you rather have a completely separate 3.8 branch the way the Spine runtimes do?
    • If multiple versions, what's the best way to handle multiple spine_c.rs files? This PR has the 3.8 version in it so it's not suitable for merging to main as is.

    I'll add docs to the PR as appropriate once it's clear how multiple versions should be handled.

    opened by pocams 5
  • Updating skeletons in parallel is not thread safe

    Updating skeletons in parallel is not thread safe

    I'm making a note of this here in case anyone tries it. It does not work. The primary suspects seems to be reference counting of attachments being non-atomic.

    https://github.com/jabuwu/rusty_spine/blob/34a326468f70e67daadaaab00237995f3837782e/src/attachment.rs#L29

    Unfortunately, this is a non-trivial fix since the C code won't play nice with Rust atomics.

    Skeletons which do not share attachments (skeletons that have a different SkeletonData as others) are probably fine to be updated in parallel.

    Attachments in general are really unsafe and could use a proper Handle type to address them safely.

    opened by jabuwu 0
Releases(0.5.0)
An serverless framework based on wasm runtime.

wasm_serverless An distributed serverless framework based on wasm runtime. Feishu doc https://fvd360f8oos.feishu.cn/docx/XSxcdONk2oVJD5xtZuicxftqn3f?f

null 3 Nov 23, 2023
The official home of the Nyson Programming Language, built off Rust.

Nyson Programming Language The official home of the Nyson Programming Language, built off Rust. (created by Nyelsonon and AMTitan, 2021) Advertisement

Nyson-Programing-Language 19 Aug 10, 2022
Parametric surfaces drawn using the Rust + WASM toolchain with WebGL, React, and TypeScript.

Parametric Surfaces in the Browser My.Movie.3.mp4 Wanted to experiment with WebGL using the Rust + WASM toolchain, with React and TypeScript to glue e

Benji Nguyen 45 Oct 21, 2022
Rust implementation of the Mina protocol, targeting Wasm and ARM architectures.

Mina-rs An implementation of Mina protocol in Rust, with focus on web and Wasm compatibility ** As you can probably tell this is a WIP! Don't use for

ChainSafe 157 Dec 12, 2022
WASM bindings for React - enables you to write and use React components in Rust

This library enables you to write and use React components in Rust, which then can be exported to JS to be reused or rendered.

Yichuan Shen 55 Dec 24, 2022
Facilitating high-level interactions between Wasm modules and JavaScript

wasm-bindgen Facilitating high-level interactions between Wasm modules and JavaScript. Guide | API Docs | Contributing | Chat Built with ?? ?? by The

Rust and WebAssembly 5.9k Jan 8, 2023
Instrument and transform wasm modules.

wasm-instrument A Rust library containing a collection of wasm module instrumentations and transformations mainly useful for wasm based block chains a

Parity Technologies 31 Dec 16, 2022
TSS of GG18 by WASM, for Confidential Transaction Generation and Signing

TSS WASM portable lightweight client application for threshold ECDSA (based on GG18), built on&for multi-party-ecdsa : Wasm HW friendly Dev yarn build

Eigen Labs 24 Dec 28, 2022
Lunatic based webserver embedding WASM. Supports scaling down to zero and up to infinity.

Frenezulo A WASM-embedding webserver build on top of submillisecond and lunatic. Build to serve as an entry point for microservices compiled to WASM.

Kai Jellinghaus 13 Oct 23, 2022
zzhack-cli is a Command Tool to help you quickly generate a WASM WebApp with simple configuration and zero code

English | δΈ­ζ–‡ζ–‡ζ‘£ zzhack-cli is a Command Tool that can help you quickly generate a WASM WebApp with simple configuration and zero code. It's worth menti

null 17 Feb 9, 2023