Skip to content
Tree: 357b120fd4
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
examples
resources
src
Cargo.toml
README.md

README.md

ggwp-zscene

ggwp-zscene is a simple scene and declarative animation manager.

Made for Zemeroth game. Historically was part of Häte crate.

This crate provides:

  • Sprites that can be shared
  • Scene and Actions to manipulate it
  • Basic layers

Examples

The following code sample shows how to create sprite, add it to the scene and move it:

let mut sprite = Sprite::from_path(context, "/fire.png", 0.5)?;
sprite.set_pos(Point2::new(0.0, -1.0));
let delta = Vector2::new(0.0, 1.5);
let time = Duration::from_millis(2_000);
let action = action::Sequence::new(vec![
    action::Show::new(&self.layers.fg, &sprite).boxed(), // show the sprite
    action::MoveBy::new(&sprite, delta, time).boxed(), // move it
]);
self.scene.add_action(action.boxed());

See examples/action.rs for a complete example.

What does a ggwp- prefix mean?

As Icefoxen asked to not use ggez- prefix I use ggwp- ("good game, well played!") to denote that the crate belongs to ggez ecosystem, but is not official.

You can’t perform that action at this time.