Protected ReadonlyaltasReadonlysignalsProtected ReadonlyslotsAssociate hash with dataUrl
Protected ReadonlyslotsTexture atlas indexing using slot coordinates. ID encodes (row, col) as: id = (row << 16) | col Decode with: row = (id >> 16) & 0xFFFF col = id & 0xFFFF
Unlike linear indexing, this is stable even if the atlas size changes. each slotId is store with a hash
Protected Readonlyslotstore the number of time a texture is used
Add a texture in the atlas
the imageUrl as hash
the dataUrl
Completely clears the atlas:
ProtectedclearProtectedcreateProtecteddecodeProtecteddrawProtecteddrawProtectedencodeFree one instance texture
Free one instance texture using the slotId instead of the hash
ProtectedfreeFree a slotId if the texture is deleted
ProtectedloadProtectedlockLock a slot for a texture and return the locked slotId if the texture is already stored, return the slotId already used, overwise return the new slotId
imageUrl as hash
Handle an atlas texture: a texture containing multiple sub-textures. Each sub-texture ID encodes its (row, col) position:
id = (row << 16) | col row = (id >> 16) & 0xFFFF col = id & 0xFFFF
This keeps IDs stable even if the atlas size changes.