Jump to content

using PhaserSpine for unatlased animation


suntabu
 Share

Recommended Posts

I'm using phaserspine(https://github.com/StudioKrok/PhaserSpine) for my game, as I need some customized characters feature I use unatlased animation.

 

But PhaserSpine only support atlased spine animation, I modefied the code get this error:

 

TypeError: sprite.texture.on is not a function
    at Phaser.Plugin.PhaserSpine.attachBitmap (http://localhost:63342/PhaserSpine/src/_oldSrc/plugin.js:106:16)
    at Phaser.GameObjectFactory.spine (http://localhost:63342/PhaserSpine/src/_oldSrc/plugin.js:51:23)
    at Phaser.StateManager.loadComplete (http://localhost:63342/PhaserSpine/src/phaser.js:30613:35)
    at Phaser.Loader.finishedLoading (http://localhost:63342/PhaserSpine/src/phaser.js:73003:25)
    at Phaser.Loader.processLoadQueue (http://localhost:63342/PhaserSpine/src/phaser.js:72958:18)
    at Phaser.Loader.asyncComplete (http://localhost:63342/PhaserSpine/src/phaser.js:73031:14)
    at Phaser.Loader.jsonLoadComplete (http://localhost:63342/PhaserSpine/src/phaser.js:73891:14)
 
the code:
/**
* [attachBitmap call _attachBitmap if baseTexture has loaded,
* otherwise set a callback to _attachBitmap on
* texture update]
*
* @param {Phaser.Sprite} sprite [the sprite to attach a bitmapData as texture]
*/
Phaser.Plugin.PhaserSpine.prototype.attachBitmap = function (sprite) {

if (sprite.texture.baseTexture.hasLoaded) {
this._attachBitmap(sprite);
}
else {
sprite.texture.on('update', this._attachBitmap.bind(this, sprite));
}
}
 
so what should I do to solved this?
thanks for help
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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