Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Showcase / BMW Spine Sprite Animation API [Tier 1]

Valued Member
Years of Service
User Offline
Joined: 1st Jun 2006
Location: Doha, Qatar
Posted: 9th Dec 2017 13:53 Edited at: 11th Dec 2017 02:24
BMW skeleton system - BMW stands for Baxslash Madbit Wilf

This API is based on Baxslash's very cool Adaptable Spine Character code:
and uses Madbits deeply awesome json api:

This API adds bone scale functionality, events and skin colors to AGK. It uses tweenchains to drive animation keys.

Baxslash code: Create sprites from spine image file, position and rotate using AppGameKit spine system.
Madbit code: Parses spine data from json spine animation file.
Wilf code: Load spine and atlas data, create and resolve tweenchain animation keys for bone position, scale, rotation and skin color, event system and asset 'load once' code to save resources.

+ Code Snippet

Load a json skeleton once, subsequent skeletons with the same path will use the same data.
Generate sprites from a Spine image atlas and attach them to bones. Apply shaders to your skeleton.
Image use is tracked internally to prevent loading the same image multiple times.
Scale bones - now you can scale in addition to rotate and translate.
Skins - animate skin visibility or colours in Spine see the results in your AppGameKit app
Events - add an Event Key in Spine to trigger a sound effect or particle in AGK.

To Do (eventually):
Support for multiple image files and atlases

Help Wanted
I'm unsure how to calculate interpolation curves from the spine file.
e.g. "curve": [ 0.25, 0, 0.75, 1 ] - how to turn that into something AppGameKit can use?

The Spine documentation says:
Quote: "Curve: The interpolation to use between this and the next keyframe. One of: linear, stepped, or an array defining a Bézier curve. Assume "linear" if omitted.
The Bézier curve array has 4 elements which define the control points: cx1, cy1, cx2, cy2. The X axis is from 0 to 1 and represents the percent of time between the two keyframes. The Y axis is from 0 to 1 and represents the percent of the difference between the keyframe's values."

Dec 10th 2017
Version 1.1
- Moved all commands to one source file and init to another - just two files + Madbits json api are needed now.
- Made events in the demo project separate from the API itself. Your event keys will look very different
Work in progress, let me know if its useful and how it can be improved


Login to view attachments
Years of Service
User Offline
Joined: 10th Oct 2010
Location: Geneva
Posted: 17th Jan 2018 23:00
Great ! Juste what i was looking for Thanks Wilf !

Do you have plan for the Spine Meshes ??

Thanks !
FPSC Reloaded TGC Backer
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 18th Jan 2018 23:59
I am hoping, to get better nativ support from TGC in AppGameKit for Skinning, Attaching things to bones and be able to Use Skeletons like 3D objects, to be able to interact in a 3D environment.

I am hoping also, to have support for Bounding-Boxes and Box2D. And the events, you can make in Spine. And also Mesh deformations.

Great work. Hope TGC will use a newer runtime for Spine and Spriter and or implement Creature (from Kestrelmoon) soon. (hoping 3 years now for better Spine support)
Valued Member
Years of Service
User Offline
Joined: 1st Jun 2006
Location: Doha, Qatar
Posted: 3rd Feb 2018 15:43
Thanks Arbrakan and Xaby!

I did have plans for meshes but I started a new job last October which as usual has limited my time and energy. It's hard to make games on the weekend when thats your day job I'm not complaining though. I get paid to make video games, live in a tax-free country, work from home and have a swimming pool 1 minute away.

I'd love to see the full Spine feature set in AppGameKit but it got deprioritized when the price of Spine went up to non-hobbyist levels. Thats pretty clear from the level of response on this forum

I'm just glad we got what we did, when we did.

Login to post a reply

Server time is: 2018-02-21 01:21:29
Your offset time is: 2018-02-21 01:21:29