↩️ Back
REQUIRES A NEWTONSOFT.JSON.DLL FILE, SEE ZIP CONFIGURATION FOR THAT
ModExtraAssets supports CodeAndWeb for sprite sheets!
Data format must to be "JSON array"
2. After creating a sprite sheet on this website, click Download: .json
3. Unused properties are: rotated
trimmed
filename
spriteSourceSize
sourceSize
meta.app
meta.version
meta.image
meta.format
meta.scale
Custom properties are:
meta.pixelsPerUnit - float (If set, acts as a default value for every sprite slice's pixelsPerUnit property (default = 100, json property path: "meta"."pixelsPerUnit"))
overridePPU - float (Individual sprite slices' Pixels Per Unit value, default value is -1, but this can be changed through json, so a specific sprite slice gets it's own "pixelsPerUnit" value)
4. If you are using .zip files to populate your database, it's recommended to create a folder called "Sprite Sheet" inside the MEA's zip file and put image file along with the json file (just like it this picture on the left)
Example names:
NameOfTheFile!sheet.png
NameOfTheFile!sheetdata.json
5. If you are using .vfp files to populate your database, there are 2 ways to go!
1. Just like with .zip files, you can create a different file that stores sprite sheet data, but naming rules are quite different.
NameOfTheFile.png
sheedata!NameOfTheFile.json
2. You can define a metadata pair (Key: meaSheetJson | Value: SOME JSON TEXT))
(Your sprite sheet image source asset entry (e.g NameOfTheFile.png) must contain a metadata pair (Key: meaTexType | Value: sheet))
SpriteSheetMEA talkingSprites = ModExtraAssets.GetEntryValue<SpriteSheetMEA("NPC_Talking_Sheet");
npc.talkList = talkingSprites.ToList();
5. To reference it via code, look at SpriteSheetMEA