Packageorg.flixel.system.debug
Classpublic class Watch
InheritanceWatch Inheritance FlxWindow Inheritance flash.display.Sprite

A Visual Studio-style "watch" window, for use in the debugger overlay. Track the values of any public variable in real-time, and/or edit their values on the fly.



Public Properties
 PropertyDefined By
  editing : Boolean
Whether a watch entry is currently being edited or not.
Watch
 InheritedmaxSize : Point
Maximum allowed X and Y dimensions for this window.
FlxWindow
 InheritedminSize : Point
Minimum allowed X and Y dimensions for this window.
FlxWindow
Protected Properties
 PropertyDefined By
 Inherited_background : Bitmap
Window display element.
FlxWindow
 Inherited_bounds : Rectangle
Controls where the window is allowed to be positioned.
FlxWindow
 Inherited_drag : Point
Helper for interaction.
FlxWindow
 Inherited_dragging : Boolean
Helper for interaction.
FlxWindow
 Inherited_handle : Bitmap
Window display element.
FlxWindow
 Inherited_header : Bitmap
Window display element.
FlxWindow
 Inherited_height : uint
Height of the window.
FlxWindow
 InheritedImgHandle : Class
FlxWindow
  _names : Sprite
Watch
 Inherited_overHandle : Boolean
Helper for interaction.
FlxWindow
 Inherited_overHeader : Boolean
Helper for interaction.
FlxWindow
 Inherited_resizable : Boolean
Helper for interaction.
FlxWindow
 Inherited_resizing : Boolean
Helper for interaction.
FlxWindow
 Inherited_shadow : Bitmap
Window display element.
FlxWindow
 Inherited_title : TextField
Window display element.
FlxWindow
  _values : Sprite
Watch
  _watching : Array
Watch
 Inherited_width : uint
Width of the window.
FlxWindow
Public Methods
 MethodDefined By
  
Watch(Title:String, Width:Number, Height:Number, Resizable:Boolean = true, Bounds:Rectangle = null, BGColor:uint = 0x7f7f7f7f, TopColor:uint = 0x7f000000)
Creates a new window object.
Watch
  
add(AnyObject:Object, VariableName:String, DisplayName:String = null):void
Add a new variable to the watch window.
Watch
  
destroy():void
[override] Clean up memory.
Watch
  
remove(AnyObject:Object, VariableName:String = null):void
Remove a variable from the watch window.
Watch
  
removeAll():void
Remove everything from the watch window.
Watch
 Inherited
reposition(X:Number, Y:Number):void
Change the position of the window.
FlxWindow
 Inherited
resize(Width:Number, Height:Number):void
Resize the window.
FlxWindow
  
submit():void
Force any watch entries currently being edited to submit their changes.
Watch
  
update():void
Update all the entries in the watch window.
Watch
Protected Methods
 MethodDefined By
 Inherited
bound():void
Keep the window within the pre-specified bounding rectangle.
FlxWindow
 Inherited
init(E:Event = null):void
Used to set up basic mouse listeners.
FlxWindow
 Inherited
onMouseDown(E:MouseEvent = null):void
Figure out if window is being repositioned (clicked on header) or resized (clicked on handle).
FlxWindow
 Inherited
onMouseMove(E:MouseEvent = null):void
Mouse movement handler.
FlxWindow
 Inherited
onMouseUp(E:MouseEvent = null):void
User let go of header bar or handler (or nothing), so turn off drag and resize behaviors.
FlxWindow
 Inherited
updateGUI():void
Figure out if the header or handle are highlighted.
FlxWindow
  
updateSize():void
[override] Update the Flash shapes to match the new size, and reposition the header, shadow, and handle accordingly.
Watch
Protected Constants
 ConstantDefined By
  LINE_HEIGHT : uint = 15
[static]
Watch
  MAX_LOG_LINES : uint = 1024
[static]
Watch
Property Detail
_namesproperty
protected var _names:Sprite

_valuesproperty 
protected var _values:Sprite

_watchingproperty 
protected var _watching:Array

editingproperty 
public var editing:Boolean

Whether a watch entry is currently being edited or not.

Constructor Detail
Watch()Constructor
public function Watch(Title:String, Width:Number, Height:Number, Resizable:Boolean = true, Bounds:Rectangle = null, BGColor:uint = 0x7f7f7f7f, TopColor:uint = 0x7f000000)

Creates a new window object. This Flash-based class is mainly (only?) used by FlxDebugger.

Parameters
Title:String — The name of the window, displayed in the header bar.
 
Width:Number — The initial width of the window.
 
Height:Number — The initial height of the window.
 
Resizable:Boolean (default = true) — Whether you can change the size of the window with a drag handle.
 
Bounds:Rectangle (default = null) — A rectangle indicating the valid screen area for the window.
 
BGColor:uint (default = 0x7f7f7f7f) — What color the window background should be, default is gray and transparent.
 
TopColor:uint (default = 0x7f000000) — What color the window header bar should be, default is black and transparent.
Method Detail
add()method
public function add(AnyObject:Object, VariableName:String, DisplayName:String = null):void

Add a new variable to the watch window. Has some simple code in place to prevent accidentally watching the same variable twice.

Parameters

AnyObject:Object — The Object containing the variable you want to track, e.g. this or Player.velocity.
 
VariableName:String — The String name of the variable you want to track, e.g. "width" or "x".
 
DisplayName:String (default = null) — Optional String that can be displayed in the watch window instead of the basic class-name information.

destroy()method 
override public function destroy():void

Clean up memory.

remove()method 
public function remove(AnyObject:Object, VariableName:String = null):void

Remove a variable from the watch window.

Parameters

AnyObject:Object — The Object containing the variable you want to remove, e.g. this or Player.velocity.
 
VariableName:String (default = null) — The String name of the variable you want to remove, e.g. "width" or "x". If left null, this will remove all variables of that object.

removeAll()method 
public function removeAll():void

Remove everything from the watch window.

submit()method 
public function submit():void

Force any watch entries currently being edited to submit their changes.

update()method 
public function update():void

Update all the entries in the watch window.

updateSize()method 
override protected function updateSize():void

Update the Flash shapes to match the new size, and reposition the header, shadow, and handle accordingly. Also adjusts the width of the entries and stuff, and makes sure there is room for all the entries.

Constant Detail
LINE_HEIGHTConstant
protected static const LINE_HEIGHT:uint = 15

MAX_LOG_LINESConstant 
protected static const MAX_LOG_LINES:uint = 1024