Class SpriteStore

java.lang.Object
model.SpriteStore

public class SpriteStore extends Object
A resource manager for sprites in the game. Its often quite important how and where you get your game resources from. In most cases it makes sense to have a central resource loader that goes away, gets your resources and caches them for future use.

[singleton]

  • Field Details

    • SPRITE_FOLDER

      protected static String SPRITE_FOLDER
  • Constructor Details

    • SpriteStore

      public SpriteStore()
  • Method Details

    • get

      public static SpriteStore get()
      Get the single instance of this class
      Returns:
      The single instance of this class
    • getSprite

      public Sprite getSprite(String ref)
      Retrieve a sprite from the store
      Parameters:
      ref - The reference to the image to use for the sprite
      Returns:
      A sprite instance containing an accelerate image of the request reference