💃 SpriteMixer for easy sprite animations

Hi there,

I made an easy-to-use tool to make sprite animations simpler, as I saw there is nothing built-in.
Have a try here : https://felixmariotto.github.io/from_indexed_texture
Here is the library’s page : https://github.com/felixmariotto/three-SpriteMixer

Briefly : After loading a texture, we give it to an instance of ActionSprite (which is an extended THREE.Sprite), then we instantiate Actions from this ActionSprite, with information about how it must play.

Main features :

action.playOnce();

action.playLoop();

action.stop();

action.pause();

action.pauseNextEnd();

action.resume();

action.clampWhenFinished;

action.hideWhenFinished;

After several requests from @Aerion, I added these features :

spriteMixer.addEventListener('finished' /* or 'loop' */, function(event) {
	console.log(event.action)
});
// Exactly like THREE.AnimationMixer, it now supports event listener functions

actionSprite.setFrame( index );
// Set one particular frame from the action

ActionSprite now can hold several actions per texture :

5 Likes