class lime.Assets

Class Fields

static var cache:AssetCache

static function exists(id:String, ?type:AssetType = null): Bool

static function getAudioBuffer(id:String, ?useCache:Bool = true): AudioBuffer

Gets an instance of an embedded sound @usage var sound = Assets.getSound("sound.wav");

id

The ID or asset path for the sound

returns

A new Sound object

static function getBytes(id:String): ByteArray

Gets an instance of an embedded binary asset @usage var bytes = Assets.getBytes("file.zip");

id

The ID or asset path for the file

returns

A new ByteArray object

static function getFont(id:String, ?useCache:Bool = true): Dynamic

Gets an instance of an embedded font @usage var fontName = Assets.getFont("font.ttf").fontName;

id

The ID or asset path for the font

returns

A new Font object

static function getImage(id:String, ?useCache:Bool = true): Image

Gets an instance of an embedded bitmap @usage var bitmap = new Bitmap(Assets.getBitmapData("image.jpg"));

id

The ID or asset path for the bitmap

useCache

(Optional) Whether to use BitmapData from the cache(Default: true)

returns

A new BitmapData object

static function getPath(id:String): String

Gets an instance of an embedded streaming sound @usage var sound = Assets.getMusic("sound.ogg");

id

The ID or asset path for the music track

returns

A new Sound object

static function getText(id:String): String

Gets an instance of an embedded text asset @usage var text = Assets.getText("text.txt");

id

The ID or asset path for the file

returns

A new String object

static function isLocal(id:String, ?type:AssetType = null, ?useCache:Bool = true): Bool

static function list(?type:AssetType = null): Array<String>

static function loadAudioBuffer(id:String, handler:AudioBuffer ->Void?useCache:Bool = true): Void

static function loadBytes(id:String, handler:ByteArray ->Void): Void

static function loadImage(id:String, handler:Image ->Void?useCache:Bool = true): Void

static function loadLibrary(name:String, handler:AssetLibrary ->Void): Void

static function loadText(id:String, handler:String ->Void): Void

static function registerLibrary(name:String, library:AssetLibrary): Void

static function unloadLibrary(name:String): Void