Skip to content

GraphicsAPI reference

Class AtlasData

Namespace: MicroEngine.Graphics
Assembly: MicroEngine.Graphics2D.dll
Guide: Graphics

The description of an atlas image written by a packing tool, read without any graphics device: the JSON of TexturePacker, Free Texture Packer and Aseprite (hash or array of frames; Aseprite’s frame durations and tags), and the Starling/Sparrow XML of TexturePacker, ShoeBox and Kenney’s packs. Trimmed frames keep their place in the untrimmed frame; rotated frames are refused (turn rotation off in the tool).

C#
public sealed class AtlasData

Inheritance

object ← AtlasData

Properties

Animations

The frame tags (Aseprite), in the file’s order; empty for formats without tags.

C#
public IReadOnlyList<AtlasAnimation> Animations { get; }

Property Value

IReadOnlyList<AtlasAnimation>

ImagePath

The atlas image as the file names it (relative to the file), or null when it names none.

C#
public string? ImagePath { get; }

Property Value

string?

Regions

The frames, in the file’s order.

C#
public IReadOnlyList<AtlasRegion> Regions { get; }

Property Value

IReadOnlyList<AtlasRegion>

Methods

Load(string, AtlasOptions?)

Reads an atlas file (JSON or XML).

C#
public static AtlasData Load(string path, AtlasOptions? options = null)

Parameters

path string

options AtlasOptions?

Returns

AtlasData

Exceptions

InvalidDataException

The file is not an atlas in a known format; the message names it.

Parse(string, AtlasOptions?)

Reads atlas JSON or XML, recognised by its first character.

C#
public static AtlasData Parse(string text, AtlasOptions? options = null)

Parameters

text string

The file’s text.

options AtlasOptions?

Pivot and naming; null for Default.

Returns

AtlasData

Exceptions

InvalidDataException

The text is not an atlas in a known format; the message says what is wrong.