class flixel.system.frontEnds.BitmapFrontEnd
Available on all platforms
Internal storage system to prevent graphics from being used repeatedly in memory.
Instance Fields
function add(Graphic:Dynamic, ?Unique:Bool = false, ?Key:String = null):CachedGraphics
Loads a bitmap from a file, clones it if necessary and caches it. * *
Graphic | The image file that you want to load. * |
Unique | Ensures that the bitmap data uses a new slot in the cache. * |
Key | Force the cache to use a specific Key to index the bitmap. * |
returns | The CachedGraphics we just created. |
function addWithSpaces(Graphic:Dynamic, FrameWidth:Int, FrameHeight:Int, ?SpacingX:Int = 1, ?SpacingY:Int = 1, ?Unique:Bool = false, ?Key:String = null):CachedGraphics
Loads a bitmap from a file, inserts spaces between frames and caches it. * Could be useful for native targets to remove possible glitches. * *
Graphic | The image file that you want to load. * |
FrameWidth | The width of frames in image * |
FrameHeight | The height of frames in image * |
SpacingX | Horizontal spaces to insert between frames in image * |
SpacingY | Vertical spaces to insert between frames in image * |
Unique | Ensures that the bitmap data uses a new slot in the cache. * |
Key | Force the cache to use a specific Key to index the bitmap. * |
returns | The CachedGraphics we just created. |
function checkCache(Key:String):Bool
Check the local bitmap cache to see if a bitmap with this key has been loaded already. * *
Key | The string key identifying the bitmap. * |
returns | Whether or not this file can be found in the cache. |
function create(Width:Int, Height:Int, Color:Int, ?Unique:Bool = false, ?Key:String = null):CachedGraphics
Generates a new BitmapData object (a colored square) and caches it. * *
Width | How wide the square should be. * |
Height | How high the square should be. * |
Color | What color the square should be (0xAARRGGBB) * |
Unique | Ensures that the bitmap data uses a new slot in the cache. * |
Key | Force the cache to use a specific Key to index the bitmap. * |
returns | The BitmapData we just created. |
Dumps bits of all cached graphics. This restores memory, but you can't read / write pixels on those graphics anymore. * You can call onContext() method for each CachedGraphic object which will restore it again.
function get(key:String):CachedGraphics
Gets cached graphics object from this storage by specified key. *
key | Key for CachedGraphics object (it's name) * |
returns | CachedGraphics with the key name, or null if there is no such object |
function getCacheKeyFor(bmd:BitmapData):String
Gets key from bitmap cache for specified bitmapdata * *
bmd | bitmapdata to find in cache * |
returns | bitmapdata's key or null if there isn't such bitmapdata in cache |
function getUniqueKey(?baseKey:String = 'pixels'):String
Gets unique key for bitmap cache * *
baseKey | key's prefix * |
returns | unique key |