class

SpriteAtlas

Dynamic sprite atlas for icon symbols. Uses shelf-first-fit bin packing. Grows from 512x512 to 4096x4096 as icons are added.

Constructor

Methods

addIcon()

addIcon(id: string, image: ImageBitmap): UVRect

Add an icon and get its UV rectangle in the atlas.

Returns UVRect

getUVRect()

getUVRect(id: string): UVRect | undefined

Get UV rectangle for a previously loaded icon.

Returns UVRect | undefined

hasIcon()

hasIcon(id: string): boolean

Check if an icon is in the atlas.

Returns boolean