### Install AsepriteDotNet via NuGet Source: https://github.com/aristurtledev/asepritedotnet/blob/develop/README.md Install the AsepriteDotNet library using the .NET CLI. Ensure you specify the desired version. ```bash dotnet add package AsepriteDotNet --version 1.9.0 ``` -------------------------------- ### Get Flattened Frame Color Data Source: https://github.com/aristurtledev/asepritedotnet/blob/develop/README.md Retrieves pixel data for a specific frame by flattening all its cels. Allows control over including visible layers, background, and tilemaps. ```csharp // Import namespaces using AsepriteDotNet.Aseprite; using AsepriteDotNet.Common; using AsepriteDotNet.IO; // Load the Aseprite file from disk. AsepriteFile file = AsepriteFileLoader.FromFile("file.aseprite"); // Flatten the frame to get the pixel data Rgba32[] framePixels = file.Frames[0].FlattenFrame(onlyVisibleLayers: true, includeBackgroundLayer: false, includeTilemapCels: false); ``` -------------------------------- ### Load Aseprite File from Disk Source: https://github.com/aristurtledev/asepritedotnet/blob/develop/README.md Demonstrates how to load an Aseprite file directly from the file system using the AsepriteFileLoader. ```csharp // Import namespaces using AsepriteDotNet.Aseprite; using AsepriteDotNet.IO; // Load the Aseprite file from disk. AsepriteFile aseFile = AsepriteFileLoader.FromFile("file.aseprite"); ``` -------------------------------- ### Process Aseprite Data with Processors Source: https://github.com/aristurtledev/asepritedotnet/blob/develop/README.md Shows how to use various out-of-the-box processors to transform Aseprite data into common formats like sprites, texture atlases, and tilemaps. ```csharp // Import namespaces using AsepriteDotNet.Aseprite; using AsepriteDotNet.Common; using AsepriteDotNet.IO; using AsepriteDotNet.Processors; // Load the Aseprite file from disk. AsepriteFile aseFile = AsepriteFileLoader.FromFile("file.aseprite"); // Create new processor options or use the provided defaults ProcessorOptions options = ProcessorOptions.Default; // Use the Sprite processor to create a sprite from a single frame Sprite sprite = SpriteProcessor.Process(aseFile, frameIndex: 0, options); // Use the TextureAtlas processor to generate a texture atlas from the Aseprite file. A TextureAtlas generates a packed texture with all frames and TextureRegion data describing the bounds of each frame in the source texture TextureAtlas atlas = TextureAtlasProcessor.Process(aseFile, options); // Use the SpriteSheet processor to generate a sprite sheet from the Aseprite file. A SpriteSheet contains a TextureAtlas as well as AnimationTags which define the animations created from tags in Aseprite. SpriteSheet spriteSheet = SpriteSheetProcessor.Process(aseFile, options); // Use the TileSetProcessor to generate a texture from a tileset in the Aseprite file Tileset tileset = TilesetProcessor.Process(aseFile, tilesetIndex: 0, options); // Use the TilemapProcessor to generate a tilemap from a specified frame in the Aseprite file Tilemap tilemap = TilemapProcessor.Process(aseFile frameIndex: 0, options); // Use the AnimatedTilemapProcess to generate an animated tilemap from the Aseprite file AnimatedTilemap animatedTilemap = AnimatedTilemapProcessor.Process(aseFile, options); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.