Packageorg.flixel.system
Classpublic class FlxTilemapBuffer
InheritanceFlxTilemapBuffer Inheritance Object

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.



Public Properties
 PropertyDefined By
  columns : uint
How many columns of tiles fit in this buffer.
FlxTilemapBuffer
  dirty : Boolean
Whether the buffer needs to be redrawn.
FlxTilemapBuffer
  height : Number
The height of the buffer (usually just a few tiles taller than the camera).
FlxTilemapBuffer
  pixels : BitmapData
[read-only] Read-only, nab the actual buffer BitmapData object.
FlxTilemapBuffer
  rows : uint
How many rows of tiles fit in this buffer.
FlxTilemapBuffer
  width : Number
The width of the buffer (usually just a few tiles wider than the camera).
FlxTilemapBuffer
  x : Number
The current X position of the buffer.
FlxTilemapBuffer
  y : Number
The current Y position of the buffer.
FlxTilemapBuffer
Protected Properties
 PropertyDefined By
  _flashRect : Rectangle
FlxTilemapBuffer
  _pixels : BitmapData
FlxTilemapBuffer
Public Methods
 MethodDefined By
  
FlxTilemapBuffer(TileWidth:Number, TileHeight:Number, WidthInTiles:uint, HeightInTiles:uint, Camera:FlxCamera = null)
Instantiates a new camera-specific buffer for storing the visual tilemap data.
FlxTilemapBuffer
  
destroy():void
Clean up memory.
FlxTilemapBuffer
  
draw(Camera:FlxCamera, FlashPoint:Point):void
Just stamps this buffer onto the specified camera at the specified location.
FlxTilemapBuffer
  
fill(Color:uint = 0):void
Fill the buffer with the specified color.
FlxTilemapBuffer
Property Detail
_flashRectproperty
protected var _flashRect:Rectangle

_pixelsproperty 
protected var _pixels:BitmapData

columnsproperty 
public var columns:uint

How many columns of tiles fit in this buffer.

dirtyproperty 
public var dirty:Boolean

Whether the buffer needs to be redrawn.

heightproperty 
public var height:Number

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

pixelsproperty 
pixels:BitmapData  [read-only]

Read-only, nab the actual buffer BitmapData object.


Implementation
    public function get pixels():BitmapData
rowsproperty 
public var rows:uint

How many rows of tiles fit in this buffer.

widthproperty 
public var width:Number

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

xproperty 
public var x:Number

The current X position of the buffer.

yproperty 
public var y:Number

The current Y position of the buffer.

Constructor Detail
FlxTilemapBuffer()Constructor
public function FlxTilemapBuffer(TileWidth:Number, TileHeight:Number, WidthInTiles:uint, HeightInTiles:uint, Camera:FlxCamera = null)

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

Parameters
TileWidth:Number — The width of the tiles in this tilemap.
 
TileHeight:Number — The height of the tiles in this tilemap.
 
WidthInTiles:uint — How many tiles wide the tilemap is.
 
HeightInTiles:uint — How many tiles tall the tilemap is.
 
Camera:FlxCamera (default = null) — Which camera this buffer relates to.
Method Detail
destroy()method
public function destroy():void

Clean up memory.

draw()method 
public function draw(Camera:FlxCamera, FlashPoint:Point):void

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

Parameters

Camera:FlxCamera — Which camera to draw the buffer onto.
 
FlashPoint:Point — Where to draw the buffer at in camera coordinates.

fill()method 
public function fill(Color:uint = 0):void

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

Parameters

Color:uint (default = 0) — What color to fill with, in 0xAARRGGBB hex format.