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...
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
Otter.Atlas.Atlas |
( |
string |
source = "" | ) |
|
Designed for Sparrow/Starling exporting from TexturePacker http://www.codeandweb.com/texturepacker
- Parameters
-
source | The reltive path to the atlas data file. The png should also be in the same directory. |
Atlas Otter.Atlas.Add |
( |
string |
source | ) |
|
Add another atlas to the collection of textures. Duplicate names will destroy this.
- Parameters
-
source | The 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
-
sources | The 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
-
source | The path until the number. For example: "assets/atlas" if the path is "assets/atlas0.xml" |
extension | The extension of the source without a dot |
- Returns
- The Atlas.
Image Otter.Atlas.CreateImage |
( |
string |
name | ) |
|
Creates a new Image from an AtlasTexture.
- Parameters
-
name | The 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
-
T | The type to use to reference animations. |
- Parameters
-
name | The name of the texture in the atlas data. |
width | The width of the cell on the sprite sheet. |
height | The 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
-
name | The name of the texture to test. |
- Returns
- True if the atlas data contains a texture by the specified name.
The documentation for this class was generated from the following file: