Packageorg.flixel
Classpublic class FlxMonitor
InheritanceFlxMonitor Inheritance Object

FlxMonitor is a simple class that aggregates and averages data. Flixel uses this to display the framerate and profiling data in the developer console. It's nice for keeping track of things that might be changing too fast from frame to frame.



Protected Properties
 PropertyDefined By
  _data : Array
An array to hold all the data we are averaging.
FlxMonitor
  _itr : uint
Keeps track of where we are in the array.
FlxMonitor
  _size : uint
Stores the requested size of the monitor array.
FlxMonitor
Public Methods
 MethodDefined By
  
FlxMonitor(Size:uint, Default:Number = 0)
Creates the monitor array and sets the size.
FlxMonitor
  
add(Data:Number):void
Adds an entry to the array of data.
FlxMonitor
  
average():Number
Averages the value of all the numbers in the monitor window.
FlxMonitor
Property Detail
_dataproperty
protected var _data:Array

An array to hold all the data we are averaging.

_itrproperty 
protected var _itr:uint

Keeps track of where we are in the array.

_sizeproperty 
protected var _size:uint

Stores the requested size of the monitor array.

Constructor Detail
FlxMonitor()Constructor
public function FlxMonitor(Size:uint, Default:Number = 0)

Creates the monitor array and sets the size.

Parameters
Size:uint — The desired size - more entries means a longer window of averaging.
 
Default:Number (default = 0) — The default value of the entries in the array (0 by default).
Method Detail
add()method
public function add(Data:Number):void

Adds an entry to the array of data.

Parameters

Data:Number — The value you want to track and average.

average()method 
public function average():Number

Averages the value of all the numbers in the monitor window.

Returns
Number — The average value of all the numbers in the monitor window.