-
Notifications
You must be signed in to change notification settings - Fork 25
Sprite MCMETA
thecodewarrior edited this page Nov 9, 2017
·
8 revisions
( look for <> elements elsewhere in this document, |xxx| elements are placeholders for real values )
{
// ... other mcmeta stuff
"spritesheet": <spritesheet>
}
<spritesheet> = {
"textureWidth": |texture width in pixels|,
"textureHeight": |texture height in pixels|,
"|sprite name|": <sprite>
}
Defines spritesheet data. The "textureWidth" and "textureHeight" values are used
to calculate the UVs for the sprites while still allowing texturepacks to rescale the
texture file for more detail.
<sprite> = [|u|, |v|, |width|, |height|] // (all ints)
Shorthand for defining a simple sprite's properties. +u is right, +v is down, and 0,0 is in the top left of the image.
<sprite> = {
"pos": [|u|, |v|, |width|, |height|],
"frames": <frames>,
"frameTime": <frametime>,
"offset": <offset>,
"ninePatch": <ninepatch>
}
<frames> = |frame count, int|
<frames> = [|frame1|, |frame2|, |frame3|, ...] // (all ints)
<frametime> = |frame time multiplier, int|
<offset> = [|u|, |v|]
Defines the position of frames. The formula for the adjusted u/v position of a frame is
[spriteU + offsetU*frameID, spriteV + offsetV*frameID] where frameID is the number used
in <frames>. Default value is [0, |sprite height|], meaning each frame is by default
immediately below the last.
<ninepatch> = [|u border|, |v border|]