npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pixi-spriter

v0.6.0

Published

Spriter animation playback engine for pixi.js.

Downloads

4

Readme

pixi-spriter

The pixi-spriter library provides a simple set of classes to (hopefully) make it easy to add animations exported from Spriter Pro in your pixi.js projects!

This is currently a massive WIP - features are largely being developed in the order in which they're required for my own projects. Feel free to raise tickets for feature requests on the issues page.

Prior to v1.0.0 this repo won't use semanyic versioning as I'd like to have everythign a bit more stable before producing a v1 release. Thereafter it will adhere to semantic versioning rules :)

Features

pixi.js integration

Loading

pixi-spriter provides a Loader Plugin for the pixi.js resource-loader.

❌ Support for .scml files.

✔️ Support for .scon files.

✔️ Atlas (spritehseet) loading.

Display

✔️ Spriter entity display component.

❌ Support for Character Maps.

Playback

✔️ Play and set animations.

    ✔️ Smoothly blend animations.

    ❌ Account for animation curves.

✔️ Change playback speed.

    ✔️ Use negative speed values for reversed playback.

Tags

Support for checking tags of animations/components is added through a set of functions in the TagUtils module. There aren't any convenience functions added to the display components so that if your project doesn't use the feature then the code won't be in your final bundle (assuming your bundler kaes use of tree-shaking).

The TagChecker class provides some convenience methods and can be reused for querying different Animator instances.

Variables

❌ TODO

Action Points

Action Points are managed by the Animator and are interpolated like the other timeline objects (bones, and sprites). They can be retrieved (when available) through the Spriter.getPoint() method.

Colliders

Also known as Collision Rectangles in Spriter, are also managed by the Animator. Presently only point collisions are supported. Checking for collisions is done either calling checkCollisions, or through the conveience method on the Spriter class - which calls checkCollisions internall anyway.

When calling checkCollisions directly, the point supplied must be in the same co-ordinate space as the Animator being queried. However, when using the Spriter method, the point suplpied needs to be in world (global) space; the method will handle the coordinate translation internally.

Event Triggers

The Spriter class allows for checking whether an event was triggered on the latest call to update(). isTriggered will only return true for the first frame when the Event is active - even when playing animaitons at lower speeds. Spriter also has an event: onEventTriggered which will signal whenever an event is triggered.

const anim = new Spriter();

// Listen for events triggering.
anim.onEventTriggered.add((event) => {
    console.log("Event triggered! Name:", event)
});

...

anim.update(deltaTime);

// Or check in an update loop.
if (anim.isTriggered("eventName")) {
    console.log("Event triggered just now: eventName");
}

Audio Events

❌ TODO

Performance

❌ Still need to benchmark and optimise.