C# Класс Nez.TextureAtlasGenerator.TextureAtlasPacker

Helper for arranging many small sprites into a single larger sheet.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
packSprites ( IList sourceSprites, ICollection outputSprites, bool isCompressed, ContentProcessorContext context ) : PixelBitmapContent

Packs a list of sprites into a single big texture, recording where each one was stored.

Приватные методы

Метод Описание
compareSpriteIndices ( ArrangedSprite a, ArrangedSprite b ) : int

Comparison function for sorting sprites by their original indices.

compareSpriteSizes ( ArrangedSprite a, ArrangedSprite b ) : int

Comparison function for sorting sprites by size.

copySpritesToOutput ( List sprites, IList sourceSprites, ICollection outputSprites, int width, int height ) : PixelBitmapContent

Once the arranging is complete, copies the bitmap data for each sprite to its chosen position in the single larger output bitmap.

findIntersectingSprite ( List sprites, int index, int x, int y ) : int

Checks if a proposed sprite position collides with anything that we already arranged.

guessOutputWidth ( List sprites ) : int

Heuristic guesses what might be a good output width for a list of sprites.

positionSprite ( List sprites, int index, int outputWidth ) : void

Works out where to position a single sprite.

Описание методов

packSprites() публичный статический Метод

Packs a list of sprites into a single big texture, recording where each one was stored.
public static packSprites ( IList sourceSprites, ICollection outputSprites, bool isCompressed, ContentProcessorContext context ) : PixelBitmapContent
sourceSprites IList
outputSprites ICollection
isCompressed bool
context ContentProcessorContext
Результат PixelBitmapContent