class flixel.util.FlxBitmapDataPool

Available on all platforms

BitmapData pool class. * * Notes on implementation: * get() starts searching for a suitable BitmapData from the start of the pool list * put() adds the BitmapData to the start of the pool list (removing the last one if the pool exceeds maxLength) * * @author azrafe7

Class Fields

static var length:Int

Current number of BitmapData present in the pool.

static var maxLength:Int

Maximum number of BitmapData to hold in the pool.

static function clear():Void

Disposes of all the BitmapData in the pool.

static function get(w:Int, h:Int, ?transparent:Bool = true, ?fillColor:Int = null, ?exactSize:Bool = false):BitmapData

Returns a BitmapData with the specified parameters. * If a suitable BitmapData cannot be found in the pool a new one will be created. * If fillColor is specified the returned BitmapData will also be cleared with it. * *

?exactSize

If false a BitmapData with size >= [w, h] may be returned.

static function put(bmd:BitmapData):Void

Adds bmd to the pool for future use.