Jump to content

Get sprite from cache with textureatlases


Kokos
 Share

Recommended Posts

I just started implementing textureatlases into my project, which is working perfectly for the most part.

However, in some places in my project I use game.cache.getImage, which doesn't work anymore.

 

An old game.add.sprite(x,y,key) has simply turned into game.add.sprite(x,y,atlas,key), but there is no game.cache.getImage(atlas,key).

 

I need to get the image from cache because I use it as a mask, and it doesn't need to be added to the game.

 

I fixed my problem now by simply using game.add.image, and then destroying the image after using it, but that is not an optimal solution.

 

Is there a way to get this to work?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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