my problem is getting the Sprite in a Sprite "Sheet".
public class Blocks extends Sprite{
public Blocks() throws IOException
{
super(Image.createImage("/blockSprite.png"),20,30);
}
}
"the blockSprite.png contains images of Sprites, many sprites in 1 image"
The problem here is using this line of code, how I am supposed to get the Sprite size/dimension in the image?
Sprite Sheet:
Width - 162
Height - 280
I want to know the width/height of the sprites in the sheet? and how to determine the width/height of the sprites in a Sprite Sheet?
Sprite
class and the constructor used here is obviouslySprite(Image image, int frameWidth, int frameHeight)
, which suggests that the second and third parameter are your sprite size? That's the part I'm confused about. If that isn't what you're looking for, try to add some sample code to demonstrate where you're missing some value or where you'd like to put it. Please consider that you have to either name the number of rows/columns or the width/height of frames. You have define one or the other. – Mariosuper(Image.createImage("/kirby.png"),32,48);
. i want to name the width/height of frames. – Christian Eric Paran