Packageaway3d.debug
Classpublic class AwayStats
InheritanceAwayStats Inheritance flash.display.Sprite

Stats monitor for Away3D or general use in any project. The widget was designed to display all the necessary data in ways that are easily readable, while maintaining a tiny size.

The following data is displayed by the widget, either graphically, through text, or both.

There are two display modes; standard and minimized, which are alternated by clicking the button in the upper right corner, at runtime. The widget can also be configured to start in minimized mode by setting the relevant constructor parameter.

All data can be reset at any time, by clicking the lower part of the widget (where the RAM and POLY counters are located. The average FPS can be reset separately by clicking it's displayed value. Furthermore, the stage frame rate can be increased or decreased by clicking the upper and lower parts of the graph, respectively. Clicking close to the center will increment in small values, and further away will increase the steps. The graph itself is only visible in standard (as opposed to minimized) display mode.

The average FPS is calculated using one of two methods, configurable via constructor parameters. By setting the meanDataLength to a non-zero value, the number of recorded frame rate values on which the average is based can be configured. This has a tiny impact on CPU usage, which is the reason why the default number is zero, denoting that the average is calculated from a running sum since the widget was last reset.

Public Properties
 PropertyDefined by
  instance : AwayStats
[static][read-only] Holds a reference to the stats widget (or if several have been created during session, the one that was last instantiated.) Allows you to set properties and register views from anywhere in your code.
AwayStats
Public Methods
 MethodDefined by
  
AwayStats
(view3d:View3D = null, minimized:Boolean = false, transparent:Boolean = false, meanDataLength:uint = 0, enableClickToReset:Boolean = true, enableModifyFrameRate:Boolean = true)

Create an Away3D stats widget.

AwayStats
  
registerView(view3d:View3D):void
Add a view to the list of those that are taken into account when calculating on-screen and total poly counts.
AwayStats
  
unregisterView(view3d:View3D):void
Remove a view from the list of those that are taken into account when calculating on-screen and total poly counts.
AwayStats
Property detail
instanceproperty
instance:AwayStats  [read-only]

Holds a reference to the stats widget (or if several have been created during session, the one that was last instantiated.) Allows you to set properties and register views from anywhere in your code.

Implementation
    public static function get instance():AwayStats
Constructor detail
AwayStats()constructor
public function AwayStats(view3d:View3D = null, minimized:Boolean = false, transparent:Boolean = false, meanDataLength:uint = 0, enableClickToReset:Boolean = true, enableModifyFrameRate:Boolean = true)Parameters
view3d:View3D (default = null) — A reference to your Away3D view. This is required if you want the stats widget to display polycounts.
 
minimized:Boolean (default = false) — Defines whether the widget should start up in minimized mode. By default, it is shown in full-size mode on launch.
 
transparent:Boolean (default = false) — Defines whether to omit the background plate and print statistics directly on top of the underlying stage.
 
meanDataLength:uint (default = 0) — The number of frames on which to base the average frame rate calculation. The default value of zero indicates that all frames since the last reset will be used.
 
enableClickToReset:Boolean (default = true) — Enables interaction allowing you to reset all counters by clicking the bottom bar of the widget. When activated, you can also click the average frame rate trace-out to reset just that one value.
 
enableModifyFrameRate:Boolean (default = true) — When enabled, allows you to click the upper and lower parts of the graph area to increase and decrease SWF frame rate respectively.
Init Parameters
Method detail
registerView()method
public function registerView(view3d:View3D):void

Add a view to the list of those that are taken into account when calculating on-screen and total poly counts. Use this method when the stats widget is not instantiated in the same place as where you create your view, or when using several views, or when views are created and destroyed dynamically at runtime.

Parameters
view3d:View3D
unregisterView()method 
public function unregisterView(view3d:View3D):void

Remove a view from the list of those that are taken into account when calculating on-screen and total poly counts. If the supplied view is the only one known to the stats widget, calling this will leave the list empty, disabling poly count statistics altogether.

Parameters
view3d:View3D
Wiki link
Click to go to the wiki page for 'away3d.debug.AwayStats'

Code examples

Comments