Jump to content

Sprite loader error


Silom
 Share

Recommended Posts

Hey guys,

 

I just started with panda.js and have some problems using spine.

My code causes a loading error, but as far as I know 'game.addAsset' is preloading, right?

 

I would be glad if someone could help me out, maybe I just cant see it...

 

Error:

Uncaught Error: Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: spine/papapino_spine.json 

My code:

game.module(  'panda.animation').require(  'engine.core').body(function() {  // Load assets  game.addAsset('spine/papapino_spine.json');  game.addAsset('spine/papapino_spritesheet.png');  game.addAsset('spine/papapino_spritesheet.json');  Panda = game.Class.extend({    init: function(x, y) {      this.sprite = new PIXI.Spine('spine/papapino_spine.json'); // Loading Error here      // ... and so on    }  )}};
Link to comment
Share on other sites

game.module(    'game.main').body(function() {game.addAsset('papapino_spritesheet.png');game.addAsset('papapino_spine.json');game.addAsset('papapino_spritesheet.json');SceneGame = game.Scene.extend({    init: function() {        var panda = new game.Spine('papapino_spine.json');        panda.position.set(200, 500);        panda.play('walk', true);        this.stage.addChild(panda);    }});game.start();});

This code works for me, using latest 1.5.0

Link to comment
Share on other sites

Well, I still have the same issue. And I cant tell you something new at all.

 

I still have this error:

Uncaught Error: Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: spine/papapino_spine.json 

 

Maybe, it is the spine data itself. Maybe it is corrupted, I will try something new.

 

All in all, I think the whole spine usage thing is quite difficult to handle. Could you or someone else write a plugin, that make it easier to handle.

I would like to have a simple method call with the urls that loads, constructs and returns the spine object.

new SpineObject({spritesheet: 'papapino_spritesheet.png', spinedata: 'papapino_spine.json', spinesheet: 'papapino_spritesheet.json'});//Does this plus animation handler//game.addAsset('papapino_spritesheet.png');//game.addAsset('papapino_spine.json');//game.addAsset('papapino_spritesheet.json');//return new game.Spine('papapino_spine.json');

I think handling this is something very time consuming in every spine using project.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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