Otter  0.9.8.91
2d Game Development Framework based on SFML.Net
 All Classes Namespaces Functions Variables Enumerations Properties
Otter.Atlas Class Reference

Class used for loading textures from an Atlas, or a set of Atlases. This class is built to support atlases created with Sparrow/Starling exporting from TexturePacker http://www.codeandweb.com/texturepacker More...

Public Member Functions

 Atlas (string source="")
 Designed for Sparrow/Starling exporting from TexturePacker http://www.codeandweb.com/texturepacker More...
 
Atlas Add (string source)
 Add another atlas to the collection of textures. Duplicate names will destroy this. More...
 
Atlas AddMultiple (params string[] sources)
 Add multiple sources to the Atlas. More...
 
Atlas AddNumbered (string source, string extension="xml")
 Add multiple atlases from a set created by texture packer. Note: This only supports up to 10 atlases (0 - 9) More...
 
Image CreateImage (string name)
 Creates a new Image from an AtlasTexture. More...
 
Spritemap< T > CreateSpritemap< T > (string name, int width, int height)
 Creates a new Spritemap from an AtlasTexture. More...
 
AtlasTexture GetAtlasTexture (string name)
 Get an AtlasTexture by name. More...
 
bool Exists (string name)
 Tests if a texture by the specified name exists in the atlas data. More...
 

Properties

AtlasTexture this[string name] [get]
 Get an AtlasTexture by name. More...
 

Detailed Description

Class used for loading textures from an Atlas, or a set of Atlases. This class is built to support atlases created with Sparrow/Starling exporting from TexturePacker http://www.codeandweb.com/texturepacker

Constructor & Destructor Documentation

Otter.Atlas.Atlas ( string  source = "")

Designed for Sparrow/Starling exporting from TexturePacker http://www.codeandweb.com/texturepacker

Parameters
sourceThe reltive path to the atlas data file. The png should also be in the same directory.

Member Function Documentation

Atlas Otter.Atlas.Add ( string  source)

Add another atlas to the collection of textures. Duplicate names will destroy this.

Parameters
sourceThe relative path to the data file. The png should be in the same directory.
Atlas Otter.Atlas.AddMultiple ( params string[]  sources)

Add multiple sources to the Atlas.

Parameters
sourcesThe file path to the sources.
Returns
The Atlas.
Atlas Otter.Atlas.AddNumbered ( string  source,
string  extension = "xml" 
)

Add multiple atlases from a set created by texture packer. Note: This only supports up to 10 atlases (0 - 9)

Parameters
sourceThe path until the number. For example: "assets/atlas" if the path is "assets/atlas0.xml"
extensionThe extension of the source without a dot
Returns
The Atlas.
Image Otter.Atlas.CreateImage ( string  name)

Creates a new Image from an AtlasTexture.

Parameters
nameThe name of the texture in the atlas data.
Returns
The created Image.
Spritemap<T> Otter.Atlas.CreateSpritemap< T > ( string  name,
int  width,
int  height 
)

Creates a new Spritemap from an AtlasTexture.

Template Parameters
TThe type to use to reference animations.
Parameters
nameThe name of the texture in the atlas data.
widthThe width of the cell on the sprite sheet.
heightThe height of the cell on the sprite sheet.
Returns
The new Spritemap.
bool Otter.Atlas.Exists ( string  name)

Tests if a texture by the specified name exists in the atlas data.

Parameters
nameThe name of the texture to test.
Returns
True if the atlas data contains a texture by the specified name.
AtlasTexture Otter.Atlas.GetAtlasTexture ( string  name)

Get an AtlasTexture by name.

Parameters
nameThe name of the image in the atlas data.
Returns
An AtlasTexture.

Property Documentation

AtlasTexture Otter.Atlas.this[string name]
get

Get an AtlasTexture by name.

Parameters
nameThe name of the image in the atlas data.
Returns
An AtlasTexture.

The documentation for this class was generated from the following file: