Jump to content

Loading Texture Atlus JSON in Firefox


Saykrd
 Share

Recommended Posts

So I'm currently loading this spritesheet data like this:

this.load.atlas('myspritesheet', 'images/myspritesheet.png', 'images/myspritesheet.json');

Which works fine in Chrome, but as soon as I try it in firefox I get this when it actually loads the file:

SyntaxError: JSON.parse: unexpected character @ http://localhost:8000/js/phaser.min.js:9

Which is really wierd. I validated the JSON and theres nothing wrong with it. This happens for every spritesheet I try to load, and only in Firefox.

 

Any idea why this is?

 

 

Link to comment
Share on other sites

Right now, the error persists even if the JSON is as simple as this:

{    "frames": [        {            "filename": "myspritesheet instance 10000",            "frame": {                "x": 0,                "y": 0,                "w": 162,                "h": 180            },            "rotated": false,            "trimmed": false,            "spriteSourceSize": {                "x": 0,                "y": 0,                "w": 162,                "h": 180            },            "sourceSize": {                "w": 162,                "h": 180            }        }    ],    "meta": {        "app": "Adobe Flash CS6",        "version": "12.0.2.529",        "image": "myspritesheet.png",        "format": "RGBA8888",        "size": {            "w": 512,            "h": 1024        },        "scale": "1"    }}  
Link to comment
Share on other sites

My first suggestion would be change "frames" to use {} instead of [].

{    "frames": { <--- Change here...        {            "filename": "myspritesheet instance 10000",            "frame": {                "x": 0,                "y": 0,                "w": 162,                "h": 180            },            "rotated": false,            "trimmed": false,            "spriteSourceSize": {                "x": 0,                "y": 0,                "w": 162,                "h": 180            },            "sourceSize": {                "w": 162,                "h": 180            }        }    }, <--- and here    "meta": {        "app": "Adobe Flash CS6",        "version": "12.0.2.529",        "image": "myspritesheet.png",        "format": "RGBA8888",        "size": {            "w": 512,            "h": 1024        },        "scale": "1"    }}

That is the only difference I can see between your JSON and mine...

Link to comment
Share on other sites

Doesn't seem to help sadly. It's wierd, I can load a json by itself just fine, its just the load.atlus() call that makes it freak out.

 

*Edit

 

 

That might actually be it. Let me double check it...

* UPDATE:

Yup. That was it. Wow that drove me nuts, thanks.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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