Skip to content
This repository has been archived by the owner on Jan 20, 2019. It is now read-only.
/ gdx-spriter Public archive

A Spriter implementation for libgdx exclusively.

License

Zlib, Unknown licenses found

Licenses found

Zlib
LICENSE
Unknown
license.gradle
Notifications You must be signed in to change notification settings

spookygames/gdx-spriter

Repository files navigation

Important notice

This project is no longer maintained and should be considered unfit for proper production use. It is kept as is, in an archived state, for historical purposes.

gdx-spriter

A Spriter implementation exclusively for libgdx. Totally ripped off from loodakrawa's brilliant .Net implementation SpriterDotNet.

Yet another implementation, come on!

gdx-spriter aims at providing the smoothest out-of-the-box experience for libgdx aficionados. To do so, it relies on the efficiency of SpriterDotNet's design and borrows some of libgdx's superpowers.

gdx-spriter should support roughly every feature supported by SpriterDotNet. SCML as well as SCON formats are supported.

Bonus feature: character maps affect sprites and sounds, yay!

Ok, still here and interested, what do I do now?

In order to bring your shiny Spriter animations into your beloved libgdx game, please follow these steps:

Before coding

  • Add a reference to gdx-spriter (download source, gradle it with jitpack, ...).

Initialization

  • In your initialization code, create some SCMLReader (resp. SCONReader) for your SCML (SCON) file.
  • Feed this reader a FileHandle of your Spriter file and get back a SpriterData object.
  • Add a SpriterAssetProvider to this object (it will manage Texture/Sound loading), the simplest one is DefaultSpriterAssetProvider.
  • For every SpriterEntity in your SpriterData, create a SpriterAnimator.

Game loop

  • Change properties of your SpriterAnimators at will.
  • In your game loop, update your SpriterAnimators with SpriterAnimator.update(deltaTime).
  • Then draw your SpriterAnimators with SpriterAnimator.draw(batch, shapeRenderer) -- the shape renderer is only used to display points and boxes and may be omitted.

Finalization

  • Don't forget to dispose your DefaultSpriterAssetProvider!

Some libgdx candy

Chances are you're using an AssetManager in your game. Good for you, gdx-spriter comes with full integration. The Initialization and Finalization part seen above can then be made much much simpler:

  • Skip everything from previous Initialization and Finalization steps.
  • Add a SpriterDataLoader to your AssetManager.
  • Load your Spriter file like you load anything else, using AssetManager.load(...).
  • Here you go, now create your SpriterAnimators.

Example

Please look at the example for a more thorough explanation.

Demo

A demo displaying most of the library's features is also available. Feel free to tinker with it in the test folder or use the demoJar gradle task to build it.

What's left to be done

Nothing's over yet, of course, and here are some points that are next in line when it comes to development schedule.

  • Hitboxes all the way down.
  • Always some issues to fix, sigh.

I'm in, let me contribute!

Anything more to say?

Post an issue here on GitHub, a thread on any relevant forum or simply drop me a line by any means you deem good. I also take pull requests, indeed.

Credits

All credits due to loodakrawa for the original .Net implementation, lucid from BrashMonkey for the official implementation and, of course, for the great piece of software that is Spriter.

UI in the demo wouldn't feel so glam without the work of Kenney.nl and @Haedri (here).

About

A Spriter implementation for libgdx exclusively.

Resources

License

Zlib, Unknown licenses found

Licenses found

Zlib
LICENSE
Unknown
license.gradle

Stars

Watchers

Forks

Packages

No packages published

Languages