Package tiles

Class Spritesheet

java.lang.Object
tiles.Spritesheet

public class Spritesheet extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    Spritesheet(Texture texture, int spriteWidth, int spriteHeight, int numSprites, int spacing)
    Takes a texture, sprite width, height, number of sprites and the pixel spacing between sprites (if applicable), and adds each sprite in the sheet to a List.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the integer size of the List of Sprites
    getSprite(int index)
    Return a single sprite by passing it's index in the sprite list
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Spritesheet

      public Spritesheet(Texture texture, int spriteWidth, int spriteHeight, int numSprites, int spacing)
      Takes a texture, sprite width, height, number of sprites and the pixel spacing between sprites (if applicable), and adds each sprite in the sheet to a List.
      Parameters:
      texture -
      spriteWidth -
      spriteHeight -
      numSprites -
      spacing -
  • Method Details

    • getSize

      public int getSize()
      Returns the integer size of the List of Sprites
      Returns:
      int size
    • getSprite

      public Sprite getSprite(int index)
      Return a single sprite by passing it's index in the sprite list
      Parameters:
      index - of the sprite
      Returns:
      Sprite
    • getSprites

      public List<Sprite> getSprites()
      Returns:
      entire list of sprites contained in Spritesheet