Sprite source

Helpers that build a minecraft:sprite_source object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. Click a type to see what it accepts.

Directory

Directory
Directory(source, prefix)
source
string

Directory of texture locations to include, relative to the textures folder, not including the trailing /.

prefix
string

The sprite name prefix, usually ending with /.

Filter

Filter
Filter(pattern)
pattern
FilterPattern

Pattern to remove sprite identifiers already in the atlas. The order of sprite sources is important.

PalettedPermutations

PalettedPermutations
PalettedPermutations(textures, palette_key, permutations, separator?)
textures
list of texture ids
palette_key
PaletteTexture
permutations
map of string to PaletteTexture
separatoroptional
string

Value to use when joining the texture and permutation names to produce the sprite name. Defaults to _.

Single

Single
Single(resource, sprite?)
resource
texture id

A single texture location of the source.

spriteoptional
texture id

The identifier of the sprite that can referenced. If not specified, matches resource.

Unstitch

Unstitch
Unstitch(resource, regions, divisor_x?, divisor_y?)
resource
texture id
regions
list of UnstitchRegion
divisor_xoptional
number

If set to the resource width, regions will use pixel coordinates.

divisor_yoptional
number

If set to the resource height, regions will use pixel coordinates.