-
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 the document, fill in |xxx| elements )
// The root file
{
// ... other mcmeta stuff
"spritesheet": <spritesheet>
}
// The spritesheet data
<spritesheet> = {
"textureWidth": |texture width in pixels|,
"textureHeight": |texture height in pixels|,
"|sprite name|": <sprite>
}
// Shorthand for defining a simple sprite's properties
// +u is right, +v is down
<sprite> = [|u|, |v|, |width|, |height|] // (all ints)
Defines a single sprite's properties. All but `"pos"` are optional
= { "pos": [|u|, |v|, |width|, |height|], "frames": , "frameTime": , "offset": , "ninePatch": }
Defines a simple number of one-tick frames. Shortcut for `[0, 1, 2, 3, ... frame count-1]`
= |frame count, int|
Defines a sequence of frames, with each array element corresponding to a
single tick.
= [|frame1|, |frame2|, |frame3|, ...] // (all ints)
Defines the number of ticks each specified frame will be repeated.
= |frame time multiplier, int|
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.
= [|u|, |v|]
Defines the width of the borders on the U and V axes of the texture. If both of these are
null or `"ninePatch"` is unspecified the texture will not act as a ninepatch. Reducing one
or the other of these to zero will effectively reduce the sprite to a middle and two caps.

= [|u border|, |v border|]