eloguvnah Posted May 14, 2013 Share Posted May 14, 2013 Hey guys, I've been trying to use addTextureAtlas but, alas, I keep getting an error "Uncaught SyntaxError: Unexpected token < phaser.js:6928 "Not sure if this is a bug in my code or in phaser. Here's my code. Thanks guys (function () { var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update); function init() { myGame.loader.addTextureAtlas( 'linkSheet', 'assets/link-sheet.png', 'assets/link-sheet.xml' ); myGame.loader.load(); } var link; function create() { link = myGame.createSprite( 50, 50, 'linkSheet' ); link.animations.add('walk', ['link-walk-1.png','link-walk-2.png'], 10, true, false ); link.animations.play('walk'); } function update() { }})(); Link to comment Share on other sites More sharing options...
rich Posted May 14, 2013 Share Posted May 14, 2013 You need to use JSON formatted texture atlas data It doesn't support XML format yet, sorry. What package are you using to generate the texture atlases? Link to comment Share on other sites More sharing options...
eloguvnah Posted May 15, 2013 Author Share Posted May 15, 2013 Ah... I'm using Shoebox which I don't think exports out a JSON but no biggie Link to comment Share on other sites More sharing options...
rich Posted May 15, 2013 Share Posted May 15, 2013 True it doesn't - can you file it as a github issue please to add in support for Starling/Sparrow (xml format) so I don't forget Link to comment Share on other sites More sharing options...
eloguvnah Posted May 15, 2013 Author Share Posted May 15, 2013 Will do. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts