class flixel.util.loaders.CachedGraphics

Available on all platforms

Instance Fields

var assetsClass:Class<BitmapData>

Class name for the BitmapData

var assetsKey:String

Asset name from openfl.Assets

var bitmap:BitmapData

Cached BitmapData object

var canBeDumped:Bool

Whether the BitmapData of this cached object can be dumped for decreased memory usage.

var data:TexturePackerData

TexturePackerData associated with the BitmapData

var destroyOnNoUse:Bool

Whether we should destroy this CachedGraphics object when useCount become zero. * Default is false.

var isDumped:Bool

Whether the BitmapData of this cached object has been dumped or not.

var key:String

Key in BitmapFrontEnd cache

var persist:Bool

Whether this cached object should stay in cache after state changes or not.

var useCount:Int

Usage counter for this CachedGraphics object.

function new(Key:String, Bitmap:BitmapData, ?Persist:Bool = false):Void

function destroy():Void

function dump():Void

Dumps bits of bitmapdata = less memory, but you can't read / write pixels on it anymore * (but you can call onContext() method which will restore it again)

function onContext():Void

Use this method to restore cached bitmapdata (if it's possible). * It's called automatically when the RESIZE event occurs.

function undump():Void

Undumps bits of bitmapdata - regenerates it and regenerate tilesheet data for this object