Skip to main content
Version: 1.0.0-preview.34

Velaptor.Content.AtlasData

Velaptor

Velaptor.Content

AtlasData Class

Holds data relating to a texture atlas.

public sealed class AtlasData :
Velaptor.Content.IAtlasData,
Velaptor.Content.IContent

Inheritance System.Object → AtlasData

Implements IAtlasData, IContent

Constructors

AtlasData(IItemCache<string,ITexture>, IDirectory, IPath, IEnumerable<AtlasSubTextureData>, string, string) Constructor

Initializes a new instance of the AtlasData class.

public AtlasData(Velaptor.Content.Caching.IItemCache<string,Velaptor.Content.ITexture> textureCache, System.IO.Abstractions.IDirectory directory, System.IO.Abstractions.IPath path, System.Collections.Generic.IEnumerable<Velaptor.Graphics.AtlasSubTextureData> atlasSubTextureData, string dirPath, string atlasName);

Parameters

textureCache Velaptor.Content.Caching.IItemCache<System.String,ITexture>

Caches textures for later use to improve performance.

directory System.IO.Abstractions.IDirectory

Performs operations with directories.

path System.IO.Abstractions.IPath

Processes directory and file paths.

atlasSubTextureData System.Collections.Generic.IEnumerable<AtlasSubTextureData>

The sub texture data of all sub textures in the atlas.

dirPath System.String

The path to the content.

atlasName System.String

The name of the atlas.

Exceptions

System.ArgumentNullException
Thrown if any of the constructor parameters are null.

System.IO.DirectoryNotFoundException
Thrown if the dirPath does not exist.

Properties

AtlasDataFilePath

Gets the file path to the atlas data.

public string AtlasDataFilePath { get; }

Implements AtlasDataFilePath

Property Value

System.String

FilePath

Gets the path to the texture.

public string FilePath { get; }

Implements FilePath

Property Value

System.String

Height

Gets the height of the entire texture atlas texture.

public uint Height { get; }

Implements Height

Property Value

System.UInt32

Name

Gets the name of the atlas.

public string Name { get; }

Implements Name

Property Value

System.String

SubTextureNames

Gets a list of unique sub texture names.

public System.Collections.Generic.IReadOnlyCollection<string> SubTextureNames { get; }

Implements SubTextureNames

Property Value

System.Collections.Generic.IReadOnlyCollection<System.String>

Remarks

Will not return duplicate names of animating sub textures.
Animating sub textures will have identical names.

Texture

Gets the the texture of the atlas.

public Velaptor.Content.ITexture Texture { get; }

Implements Texture

Property Value

ITexture

this[int]

The iterator for the atlas sub texture data.

public Velaptor.Graphics.AtlasSubTextureData this[int index] { get; }

Parameters

index System.Int32

The index of the item to retrieve.

Implements this[int]

Property Value

AtlasSubTextureData

Width

Gets the width of the entire texture atlas texture.

public uint Width { get; }

Implements Width

Property Value

System.UInt32

Methods

GetFrames(string)

Gets the all of the frames that have the given sub texture id.

public Velaptor.Graphics.AtlasSubTextureData[] GetFrames(string subTextureId);

Parameters

subTextureId System.String

The sub texture ID of the frames to return.

Implements GetFrames(string)

Returns

AtlasSubTextureData[]
The list of frame rectangles.