Manages frame buffers and gives access to each frame buffer.

Constructor

new(camera:FlxCamera)

Creates a frame buffer manager that targets camera.

Parameters:

camera

the target camera.

Methods

@:value({ color : null })copySpriteTo(name:String, sprite:FlxSprite, ?color:FlxColor):Void

Adds a copy of the sprite to the frame buffer.

Parameters:

name

the name of the frame buffer

sprite

the sprite

color

if this is not null, the sprite will be filled with the color. if this is null, the sprite will keep its original color.

createFrameBuffer(name:String, bgColor:FlxColor):BitmapData

Creates a new frame buffer with a name.

Parameters:

name

the name

bgColor

the background color

Returns:

the bitmap data of the frame buffer. the bitmap data instance will not be changed through frame buffer updates.

dispose():Void

Disposes all frame buffers. The instance can be reused.

getFrameBuffer(name:String):BitmapData

Returns the bitmap data of the frame buffer

Parameters:

name

the name of the frame buffer

Returns:

the bitmap data

lock():Void

Call this before drawing anything.

moveSpriteTo(name:String, sprite:FlxSprite):Void

Adds the sprite to the frame buffer. The sprite will only be seen from the frame buffer.

Parameters:

name

the name of the frame buffer

sprite

the sprite

unlock():Void

Unlocks the frame buffers. This updates the bitmap data of each frame buffer.