rusty_skelform_macroquad

Crates.iorusty_skelform_macroquad
lib.rsrusty_skelform_macroquad
version0.2.2
created_at2025-07-08 02:14:42.5475+00
updated_at2026-01-05 19:39:27.978943+00
descriptionSkelForm Macroquad runtime
homepage
repository
max_upload_size
id1741971
size1,127,498
(Retropaint)

documentation

README

Library for running SkelForm animations in Macroquad.

Example

A basic character example is included in /examples.

in the /examples folder:

cargo run --example basic

Basic Setup

use rusty_skelform_macroquad as skf_mq;
  • skf_mq::load() - loads .skf file and returns armature & textures, to be used later
  • skf_mq::animate() - transforms the armature's bones based on the animation(s)
  • skf_mq::construct() - provides the bones from this armature that are ready for use
  • skf_mq::draw() - draws the bones on-screen, with the provided style(s)

1. Load:

let (mut armature, textures) = skf_mq::load("armature.skf")

This should only be called once (eg; before main game loop), and armature and textures should be kept for later use.

2. Animate:

# use `skf_mq.time_frame()` to get the animation frame based on time (1000 = 1 second)
time: std::time::Instant = std::time::Instant::now();
let time_frame = skf_mq::time_frame(time, &armature.animations[0], false, true);

skf_mq::animate(
    &mut armature.bones,
    &vec![&armature.animations[0]],
    &vec![time_frame],
    &vec![0],
);

Note: not needed if armature is statilc

3. Construct:

let options = skf_mq::ConstructOptions {
  position: Vec2::new(screen_width()/2, screen_height()/2),
  ..Default::default()
};

let mut final_bones = skf_mq::construct(&armature, options);

Modifications to the armature (eg; aiming at cursor) may be done before or after construction.

4. Draw:

skf_mq::draw(
    &mut final_bones,
    &textures,
    &vec![&armature.styles[0]],
);
Commit count: 0

cargo fmt