I searched through the API for SpriteSheet, but I couldn't find anything on how to make a sprite sheet with different sized sprites.
The sprite sheet that I'm using has a row of 16x16px tiles, a row of 24x24px tiles under it, a row of 8x8px under that, and so on.
Originally, not using Slick2D, I used BufferedImage.getSubimage() to obtain each sprite from a temporary BufferedImage of the sprite sheet. Is there a similar method here that I can use?
I don't believe there is a way to do a direct sub-image in the current version of the API, at least at the time of this writing.
However, there are three possible options that I can think of (in addition to the option of just adding said method calls yourself - it's open source after all):
SpriteSheet
objects from the same source Image
, one for each Sprite size, if you really want to keep them in the same source file.Image
instance, and call getSubImage
on it to split the Image
into three images, one for each size (24x24, 16x16, and so on). Then, from those sub-images, instantiate SpriteSheets
.