-
Notifications
You must be signed in to change notification settings - Fork 2
TilesetFactory
sirrandalot edited this page Mar 16, 2018
·
3 revisions
TilesetFactory contains static methods for creating Tilesets.
- Returns a blank Tileset given the tile size and number of tiles.
- Returns a Tileset based on an array of values.
- Returns a Tileset based on an array of tiles.
- Returns a pre-defined Tileset based on a TilesetPredef enum value.
static Tileset getTilesetFromImage(BufferedImage img, int tileWidth, int tileHeight, int numX, int numY, int thresh)
- Returns a Tileset based on a BufferedImage and given the tile size as well as how many horizontal and vertical columns/rows there are in the image.
- Currently, the red value of the image pixel is used to determine whether a value is 0 or 1, and
thresh
is used as the threshold: if red value > thresh, a pixel will be foreground.