ResourceLoader.packImages

Combine the given images to create an atlas map. Each image must be square with dimensions equal to a power of two, eg. 32×32 or 128x128. All images must be of equal size.

UV type must be a RectangleI or struct containing RectangleIs. The new mapping will offset the positions of those rectangles to match those of the newly made image.

If given only one image, returns it unchanged.

interface ResourceLoader
static
Image
packImages
(
UV
Type
)
(
return scope UV[Type][] mapping
,
return scope Image[] images
,
out UV[Type] newMapping
)
in (mapping.length == images.length, "Map and image count must be equal")
out (r; !(r.width & (r.width - 1)), "Output image must have dimensions equal to a power of two")

Meta