Atlas

A texture atlas

Constructors

this
this(size_t atlasSize, int padding, float scale)

Constructs a new atlas with the specified size

Members

Functions

clear
void clear()

Clears the texture packer

finalize
void finalize()

Finalize the atlas

pack
bool pack(Part p)

Packs a part in to a atlas, returns whether this was successful atlasArea contains the area in the atlas that the texture was packed in to.

resize
void resize(size_t atlasSize)

Resizes the atlas

Variables

mappings
rect[uint] mappings;

Mappings from part UUID to an area on the atlas

packer
TexturePacker packer;

MaxRects texture packer

padding
int padding;

How much padding in pixels to apply

scale
float scale;

The scale of every element

textures
Texture[TextureUsage.COUNT] textures;

The underlying textures

Meta