6 releases
| new 0.2.2 | Jan 5, 2026 |
|---|---|
| 0.2.1 | Jan 5, 2026 |
| 0.2.0 | Dec 31, 2025 |
| 0.1.2 | Jul 15, 2025 |
#5 in #animate
1MB
125 lines
Contains (Zip file, 555KB) examples/skellington.skf, (Zip file, 535KB) examples/skellina.skf
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.skffile and returns armature & textures, to be used laterskf_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 useskf_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]],
);
Dependencies
~20MB
~447K SLoC