The sprite sheet converter tool.
You can use this tool to convert 1 sheet of sprites as 1 picture into an array of bytes. This array can be put in your code, so that you can show an animated sprite on the arduboy screen.
The specificaton of the image.
The image must have the following characteristics:
- a sprite sheet has 1 column of sprite frames vertically arranged
- the top frame is the first one, bottom frame the last one
- 100% pure black, 100% pure white and 100% pure transparant pixels
- transparant pixels will be used to determine the mask.
- height needs to be a multiple of 8
- width does not have to be a multiple of 8
- naming is very specifiek: nameSprite_widthOfSpritexheightOfSprite (example: mySprite_12x16)
The Function(s) you could use with this array.
To show a frame of the sprite on the arduboy screen, you could use the functions drawErase + drawSelfMasked or drawPlusMask, but make sure you have updated the Arduboy2 library to at least version 3.1.1.
drawErase(xPostion, yPosition, mySprite_mask, frameNumber);
drawSelfMasked(xPostion, yPosition, mySprite, frameNumber);
Better use the drawPlusMask version:
drawPlusMask(xPostion, yPosition, mySprite_plus_mask, frameNumber);