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):
SpriteSheetobjects from the same sourceImage, one for each Sprite size, if you really want to keep them in the same source file.Imageinstance, and callgetSubImageon it to split theImageinto three images, one for each size (24×24, 16×16, and so on). Then, from those sub-images, instantiateSpriteSheets.