class flixel.tile.FlxTilemapBuffer

Available on all platforms

A helper object to keep tilemap drawing performance decent across the new multi-camera system. * Pretty much don't even have to think about this class unless you are doing some crazy hacking.

Instance Fields

var columns:Int

How many columns of tiles fit in this buffer.

var dirty:Bool

Whether the buffer needs to be redrawn.

var height:Float

The height of the buffer (usually just a few tiles taller than the camera).

var pixelPerfectRender:Bool

Whether or not the coordinates should be rounded during draw(), true by default (recommended for pixel art). * Only affects tilesheet rendering and rendering using BitmapData.draw() in blitting. * (copyPixels() only renders on whole pixels by nature). Causes draw() to be used if false, which is more expensive.

var pixels:BitmapData

The actual buffer BitmapData.

var rows:Int

How many rows of tiles fit in this buffer.

var width:Float

The width of the buffer (usually just a few tiles wider than the camera).

var x:Float

The current X position of the buffer.

var y:Float

The current Y position of the buffer.

function new(TileWidth:Int, TileHeight:Int, WidthInTiles:Int, HeightInTiles:Int, ?Camera:FlxCamera = null, ?ScaleX:Float = 1.0f, ?ScaleY:Float = 1.0f):Void

Instantiates a new camera-specific buffer for storing the visual tilemap data. * *

TileWidth

The width of the tiles in this tilemap. *

TileHeight

The height of the tiles in this tilemap. *

WidthInTiles

How many tiles wide the tilemap is. *

HeightInTiles

How many tiles tall the tilemap is. *

Camera

Which camera this buffer relates to.

function destroy():Void

Clean up memory.

function draw(Camera:FlxCamera, FlashPoint:Point, ?ScaleX:Float = 1.0f, ?ScaleY:Float = 1.0f):Void

Just stamps this buffer onto the specified camera at the specified location. * *

Camera

Which camera to draw the buffer onto. *

FlashPoint

Where to draw the buffer at in camera coordinates.

function fill(?Color:Int = 0):Void

Fill the buffer with the specified color. * Default value is transparent. * *

Color

What color to fill with, in 0xAARRGGBB hex format.

function updateColumns(TileWidth:Int, WidthInTiles:Int, ?ScaleX:Float = 1.0f, ?Camera:FlxCamera = null):Void

function updateRows(TileHeight:Int, HeightInTiles:Int, ?ScaleY:Float = 1.0f, ?Camera:FlxCamera = null):Void