Jump to content

A (very) Basic Spine Plugin


fillmoreb
 Share

Recommended Posts

IMPORTANT UPDATE (6/24/16): 

Don't bother using this plugin.  It doesn't work well, I made many mistakes, and I'm abandoning it in favor of a better written plugin by @Str1ngS.  (At least I think it's written by him...)  Here's the github link:

https://github.com/orange-games/phaser-spine

I'm going to leave my stuff up for posterity, but seriously... Don't use it if you value your own sanity.

Hey everybody.  I needed to get Spine working with Phaser for a job, and thought I would share the fruits of my labor with whoever would find it interesting.  I turned my work into a Phaser Plugin, and stuck an MIT license on there.  The plugin is basic, and it doesn't support mesh deformations, because I don't need them for my project.

Here's a link to a sample so you can see how to use it:

http://www.benfillmore.com/spine/

And here is a link to the source of the plugin itself:

http://www.benfillmore.com/spine/phaser-plugin-spine.js

If you like it, reply to let me know why.  If you don't like it, reply to let me know why. :D  If there's any interest, I'll put this up onto Github as well.  

Edited by fillmoreb
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 4 weeks later...

Hi,

I'm trying to make this work with Phaser 2.4.7 but without success. My code is pretty simple :

 

game = new Phaser.Game( gameWidth , gameHeight , Phaser.AUTO, 'app_canvas');
    
pluginManager = new Phaser.PluginManager(game);
pluginManager.add(Phaser.Plugin.Spine,game);

I use PluginManager because game.plugins seems to not exist in Phaser 2.4.7

 

Later in my code, in the loading function :

game.load.atlasXML('spineboyblue',  imagePath + 'spineboy-blue.png',  imagePath + 'spineboy.xml');
        game.load.atlasXML('spineboy',      imagePath + 'spineboy.png',       imagePath + 'spineboy.xml');

game.load.json('spineboyjson', imagePath + 'spineboy.json');

 

Later, in the create function :

this.spineSprite = game.add.spineSprite(200,200,"spineboyjson","spineboy");
//this.spineSprite.setAnimation(this.animations[0]);
//this.spineSprite.scale.set(0.8,0.8);

 

Everything is correctly loaded - the pluginManager does contain the Spine plugin and the Spline plugin constructor is correctly called when game.add.spineSprite is called- but the spine won't show up.

 

Any idea why ? Am'I doing something wrong ?

Thanks

Link to comment
Share on other sites

  • 3 weeks later...

@bali33 Sorry for the late response, I've been very busy at work lately, so haven't had the time to check in here at the forums.  I'm not sure why you're having issues.  If you're still having trouble, go ahead and post your full source and I can help you track down the problem.

@noesgames Sorry to you for the even later response.  I haven't needed to get a notification on a completed animation, so the plugin doesn't have any system to do that.  Sorry.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...