Silom Posted May 7, 2014 Share Posted May 7, 2014 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 } )}}; Quote Link to comment Share on other sites More sharing options...
enpu Posted May 12, 2014 Share Posted May 12, 2014 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 Quote Link to comment Share on other sites More sharing options...
Silom Posted May 12, 2014 Author Share Posted May 12, 2014 Hey Enpu, thanks for the reply. The last time I tried it, I used 1.4. I will update panda.js and try it again. But first I finish the advanced keyboard plugin . Quote Link to comment Share on other sites More sharing options...
Silom Posted May 12, 2014 Author Share Posted May 12, 2014 Alright keyboard plugin done. I rewrote KeyboardJS, or should I say replaced...https://github.com/Silom/KeyboardJS Quote Link to comment Share on other sites More sharing options...
Silom Posted May 12, 2014 Author Share Posted May 12, 2014 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.