title: Loading a texture more than once in PIXI.js
body: <p>I'm trying to handle loading textures in PIXI that might already have been loaded.  PIXI throws an error if you try and load something with the same name twice.  Resetting the texture cache all the time does not seem like the solution.</p>
  
  <p>Here's how I'm trying to do it:
  </p>
  
  <pre><code>resources_to_load = (texture for texture in @textures(item) when !PIXI.loader.resources[texture])
  if resources_to_load.length &gt; 0
    PIXI.loader.add(resources_to_load).load setup
  else
    setup()
  </code></pre>
  
  <p>The problem I'm having is that when I am loading the textures for each sprite I filter out all the textures that have an entry in the the loader's resource object.  But for some of the sprites that leaves them with an empty array for resources_to_load.  </p>
  
  <p>Trying to add an empty [] seems to not lead to the callback being called.  So I have my check to see if its empty or not, and if its empty just call setup.  But then when I try and access the texture it throws errors.  I think because it has not actually finished loading the texture yet.</p>
  
  <p>So I'm trying to figure out a way to call setup only when the textures have actually finished loading, but I'm not having much luck</p>