An AssetCache can be used to cache and dispose of assets to control memory
use. Use AssetCache.global
to cache assets permanently.
Constructor
Variables
read only enabled : Bool
name : String
Functions
addBitmapFontSizes (fontName : String, fonts : Array<String>, format : BitmapFontFormat = BitmapFontFormat.XML, extraParams : Dynamic) : BitmapFont
Add multiple BitmapFontAtlases to a single BitmapFont, representing
multiple sizes of a single font. You can then reference this font as
fontName
in place of a bitmap font asset. BitmapText will
automatically use the most appropriate size of the font when rendering.
addResolutions (id : String, assets : Array<String>) : AtlasResolutions
Register multiple assets as different resolutions of a single image.
After calling this method, use id wherever image assets are
expected: new Image(id)
. Graphics will pick the appropriate
resolution from the list when rendering this asset.
addTextureAtlas (atlas : TextureAtlas) : Void
Add all of the regions from a TextureAtlas to the AssetCache.
After calling this method, regions can be specified wherever images
assets are expected, e.g. new Image("my_atlas_region")
.