A resource manager.

Available since

0.1.0

.

Static variables

@:value([])staticfinalread onlyfileListeners:Array<FileListener> = []

Contains FileListeners.

@:value(new MapArray())staticfinalread onlysavedAtlases:MapArray<Atlas> = new MapArray()

Contains stored nb.Atlas instances.

@:value(new MapArray())staticfinalread onlysavedTextures:MapArray<Texture> = new MapArray()

Contains stored h3d.mat.Texture instances.

Static methods

staticinlineaddAtlas(atlas:Atlas, ?name:String):String

Stores an nb.Atlas instance under a unique name, the instance name is ignored.

Parameters:

atlas

The nb.Atlas instance to store.

name

A unique name to give to the stored texture. If null the instance name is used.

Returns:

The name atlas is stored under.

staticinlineaddTexture(tex:Texture, ?name:String):String

Stores a texture under a unique name, the instance name is ignored.

Parameters:

tex

The h3d.mat.Texture to store.

name

A unique name to give to the stored texture. If null the instance name is used.

Returns:

The name tex is stored under.

staticinlinegetAtlasByName(name:String):Null<Atlas>

Returns an nb.Atlas stored under that name.

staticinlinegetTextureById(id:Int):Texture

Returns a stored texture with matching id.

staticinlinegetTextureByName(name:String):Texture

Returns a stored texture with the unique name given.

staticinlinegetTexturePart(tex:Texture, x:Float, y:Float, w:Float, h:Float):Texture

Returns a part of a texture as a new texture or a cached texture.

staticinlinegetWhiteTex():Texture

Returns a new white texture, or a cached one if one was already made by this class.

staticinlinegetWhiteTile():Tile

Returns a new white tile from this class's white texture.

staticinit(onFinished:() ‑> Void):Void

Initalizes this class. Should be called once, at the start of the app.

staticonFileChanged(file:FileEntry):Void

Gets called when any file changes to trigger the file listeners.