title: Loading sprite sheet in pixi v3
body: <p>I'm trying to learn Pixi.js for a game I'd like to code, but I'm having the hardest time with one of the most basic tasks: loading a sprite sheet.
  The real problem is that Pixi v3 broke compatibility with an old way to load sprites, which was apparently <code>PIXI.AssetLoader()</code>. All the tutorials I can find use that method, but when I tried to use it, PIXI threw an error telling me to use their <code>PIXI.loader.Loader</code> class. I'd prefer to use the most recent release of a library, so that's fair enough.</p>
  
  <p>I looked up their documentation here:
  <a href="http://pixijs.github.io/docs/PIXI.loaders.Loader.html" rel="nofollow">http://pixijs.github.io/docs/PIXI.loaders.Loader.html</a></p>
  
  <p>The problem is, the documentation is sparse (it doesn't even describe the methods that belong to the class). I can figure out how to load a single image as a texture...I think... but I want to load sprite sheets! And the most frustrating thing is that the home page prominently announces support for sprite sheet loading. So how do you do it?</p>
  
  <p>The best I've got based on what I could glean is this:</p>
  
  <p>This is my sprite sheet JSON:</p>
  
  <pre><code>{
    "frames": {
      "exampleFrame1.png": {
        "frame": {"x":0, "y":0, "w":100, "h":100},
        "rotated": false,
        "trimmed": false,
        "spriteSourceSize": {"x":0, "y":0, "w":100, "h":100},
        "sourceSize": {"w": 100, "h": 100}
      }
    },
  
    "meta": {
      "image": "./images/example-sprite-sheet.png"
    }
  }
  </code></pre>
  
  <p>And this is the code requesting the sprite:</p>
  
  <pre><code>var sprite;
  var loader = new PIXI.loaders.Loader("./images", 5);
  loader.add('example-sprites', 'example-sprite-sheet.json');
  loader.on('complete', onAssetLoad);
  loader.load();
  
  function onAssetLoad(){
    sprite = PIXI.Sprite.fromFrame("exampleFrame1.png");
    //attach sprite to stage etc...
  }
  </code></pre>
  
  <p>I could be way off-base with that code above, but I can't find anything in Pixi's documentation, and even all the tutorials and examples they have on their site are using the broken <code>PIXI.AssetLoader()</code> method.</p>
  
  <p>Does anyone know how to do what I'm trying to do in Pixi v3? Or better yet, does anyone know where I can actually find the information I need?</p>