Class SpriteTileset

java.lang.Object
games.stendhal.client.sprite.SpriteTileset
All Implemented Interfaces:
Tileset

public class SpriteTileset extends Object implements Tileset
A tileset that is created from a source sprite.
  • Constructor Details

    • SpriteTileset

      public SpriteTileset(SpriteStore store, String filename, Color color, Composite blend)
      Create a tileset.
      Parameters:
      store - A sprite store.
      filename - A sprite resource path.
      color - Adjustment color for the tileset, or null
      blend - Blend mode for applying the adjustment color, or null
    • SpriteTileset

      public SpriteTileset(SpriteStore store, Sprite sprite, int size)
      Create a tileset.
      Parameters:
      store - A sprite store.
      sprite - A source sprite.
      size - The tile size.
  • Method Details

    • getSize

      public int getSize()
      Get the number of tiles.
      Specified by:
      getSize in interface Tileset
      Returns:
      The number of tiles.
    • getSprite

      public Sprite getSprite(int index)
      Get the sprite for an index tile of a tileset.
      Specified by:
      getSprite in interface Tileset
      Parameters:
      index - The index with-in the tileset.
      Returns:
      A sprite, or null if no mapped sprite.