-
Notifications
You must be signed in to change notification settings - Fork 38
Sprite sheet
UniStores can have a sprite sheet to have icons for the apps, this need to be in .t3x format which can be generated with devkitPro's tex3ds.
To make the .t3x file you will need a .t3s file and image files. The .t3s should contain something like:
--atlas -f rgba -z auto
0.png
1.png
Where 0.png and 1.png are app icons in the same directory. The app icons should be up to 48x48 and the order they are in the .t3s file will be the order for icon_index in their info section.
You can then generate the t3x by running:
tex3ds -i path/to/file.t3s -o path/to/file.t3xImportant things to know:
-
The first
icon_indexis zero. -
Only PNG file format can be used.
-
An
atlasmap needs to be fit on an 1024x1024 plane, so the maximum number of icons on one spritesheet is limited. Some icon sizes and the formula and the corresponding number of icons are in the following table:Icon size Max number of icons 16x16 4096 32*32 1024 48*48 442 X*Y (1024 modulo X)*(1024 modulo Y) -
Instead of downsizing the icons, you can use multiple spritesheets too. (see
sheet_index)
Sample Python code to convert any graphics to icons:
#Image resize to icon size with keeping aspect ratio and convert to PNG format
import PIL
from PIL import Image
#the wanted iconsize is 48x48
iconsize = (48,48)
img = Image.open("something.jpg")
img.thumbnail(iconsize)
img.save("something.png")
#Note: Python knows from the file extension that the image needs to be converted to .PNG formatNeed help? Join our Discord server or create a discussion.