TextureAtlasManager

public class
loom2d.ui.TextureAtlasManager

Description

Manager for registering texture atlases globally by name for use with TextureAtlasSprite.

Because LML doesn't give us an easy way to get at arbitrary object references, we just use a static class and string lookups for this purpose. It also helps us avoid loading the same texture atlas multiple times, hopefully saving on memory.

See also:
Loom.Textures.TextureAtlas

API overview

Constructor

TextureAtlasManager ()

Attributes

Protected attributes

Functions

Public functions

getTexture ( atlasName: String , frameName: String ): Texture static

Look up a texture from an atlas previously registered

register ( name: String , path: String ): Void static

Register a texture atlas for later use

Constructor

TextureAtlasManager ()

Attributes

Protected attributes

Functions

getFullTypeName (): String
Inherited from Object

native

Gets the fully qualified type name of the Object. The fully qualified type name includes the package of the type.


Returns

String fully qualified type name of the Object.

getTexture ( atlasName: String , frameName: String ): Texture

static

Look up a texture from an atlas previously registered.

Parameters

atlasName: String The name of the atlas (ie, "Monsters")
frameName: String The frame (ie, "walk_0001" - whatever you set up in the atlas)


getType (): Type
Inherited from Object

native

Gets the Type that describes the Object.


Returns

Type The Type that describes the object.

getTypeName (): String
Inherited from Object

native

Gets the type name of the Object.


Returns

String type name of the Object.

register ( name: String , path: String ): Void

static

Register a texture atlas for later use. You provide a name ("Monsters") and its path ("assets/sheets/") - this is combined into a file to load ("assets/sheets/Monsters.xml"), and the path is used for resolving any textures referenced by the atlas, which should be in the same directory.

Parameters

name: String @param parentPath
path: String


toString (): String
Inherited from Object

native

Returns a String that describes the Object. This can be overriden to provide extra details when printing objects using trace().


Returns

String String that described the Object.

: