Packageorg.flixel.system
Classpublic class FlxWindow
InheritanceFlxWindow Inheritance flash.display.Sprite
Subclasses Log, Perf, Watch

A generic, Flash-based window class, created for use in FlxDebugger.



Public Properties
 PropertyDefined By
  maxSize : Point
Maximum allowed X and Y dimensions for this window.
FlxWindow
  minSize : Point
Minimum allowed X and Y dimensions for this window.
FlxWindow
Protected Properties
 PropertyDefined By
  _background : Bitmap
Window display element.
FlxWindow
  _bounds : Rectangle
Controls where the window is allowed to be positioned.
FlxWindow
  _drag : Point
Helper for interaction.
FlxWindow
  _dragging : Boolean
Helper for interaction.
FlxWindow
  _handle : Bitmap
Window display element.
FlxWindow
  _header : Bitmap
Window display element.
FlxWindow
  _height : uint
Height of the window.
FlxWindow
  ImgHandle : Class
FlxWindow
  _overHandle : Boolean
Helper for interaction.
FlxWindow
  _overHeader : Boolean
Helper for interaction.
FlxWindow
  _resizable : Boolean
Helper for interaction.
FlxWindow
  _resizing : Boolean
Helper for interaction.
FlxWindow
  _shadow : Bitmap
Window display element.
FlxWindow
  _title : TextField
Window display element.
FlxWindow
  _width : uint
Width of the window.
FlxWindow
Public Methods
 MethodDefined By
  
FlxWindow(Title:String, Width:Number, Height:Number, Resizable:Boolean = true, Bounds:Rectangle = null, BGColor:uint = 0x7f7f7f7f, TopColor:uint = 0x7f000000)
Creates a new window object.
FlxWindow
  
destroy():void
Clean up memory.
FlxWindow
  
reposition(X:Number, Y:Number):void
Change the position of the window.
FlxWindow
  
resize(Width:Number, Height:Number):void
Resize the window.
FlxWindow
Protected Methods
 MethodDefined By
  
bound():void
Keep the window within the pre-specified bounding rectangle.
FlxWindow
  
init(E:Event = null):void
Used to set up basic mouse listeners.
FlxWindow
  
onMouseDown(E:MouseEvent = null):void
Figure out if window is being repositioned (clicked on header) or resized (clicked on handle).
FlxWindow
  
onMouseMove(E:MouseEvent = null):void
Mouse movement handler.
FlxWindow
  
onMouseUp(E:MouseEvent = null):void
User let go of header bar or handler (or nothing), so turn off drag and resize behaviors.
FlxWindow
  
updateGUI():void
Figure out if the header or handle are highlighted.
FlxWindow
  
updateSize():void
Update the Flash shapes to match the new size, and reposition the header, shadow, and handle accordingly.
FlxWindow
Property Detail
_backgroundproperty
protected var _background:Bitmap

Window display element.

_boundsproperty 
protected var _bounds:Rectangle

Controls where the window is allowed to be positioned.

_dragproperty 
protected var _drag:Point

Helper for interaction.

_draggingproperty 
protected var _dragging:Boolean

Helper for interaction.

_handleproperty 
protected var _handle:Bitmap

Window display element.

_headerproperty 
protected var _header:Bitmap

Window display element.

_heightproperty 
protected var _height:uint

Height of the window. Using Sprite.height is super unreliable for some reason!

_overHandleproperty 
protected var _overHandle:Boolean

Helper for interaction.

_overHeaderproperty 
protected var _overHeader:Boolean

Helper for interaction.

_resizableproperty 
protected var _resizable:Boolean

Helper for interaction.

_resizingproperty 
protected var _resizing:Boolean

Helper for interaction.

_shadowproperty 
protected var _shadow:Bitmap

Window display element.

_titleproperty 
protected var _title:TextField

Window display element.

_widthproperty 
protected var _width:uint

Width of the window. Using Sprite.width is super unreliable for some reason!

ImgHandleproperty 
protected var ImgHandle:Class

maxSizeproperty 
public var maxSize:Point

Maximum allowed X and Y dimensions for this window.

minSizeproperty 
public var minSize:Point

Minimum allowed X and Y dimensions for this window.

Constructor Detail
FlxWindow()Constructor
public function FlxWindow(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
bound()method
protected function bound():void

Keep the window within the pre-specified bounding rectangle.

destroy()method 
public function destroy():void

Clean up memory.

init()method 
protected function init(E:Event = null):void

Used to set up basic mouse listeners.

Parameters

E:Event (default = null) — Flash event.

onMouseDown()method 
protected function onMouseDown(E:MouseEvent = null):void

Figure out if window is being repositioned (clicked on header) or resized (clicked on handle).

Parameters

E:MouseEvent (default = null) — Flash mouse event.

onMouseMove()method 
protected function onMouseMove(E:MouseEvent = null):void

Mouse movement handler. Figures out if mouse is over handle or header bar or what.

Parameters

E:MouseEvent (default = null) — Flash mouse event.

onMouseUp()method 
protected function onMouseUp(E:MouseEvent = null):void

User let go of header bar or handler (or nothing), so turn off drag and resize behaviors.

Parameters

E:MouseEvent (default = null) — Flash mouse event.

reposition()method 
public function reposition(X:Number, Y:Number):void

Change the position of the window. Subject to pre-specified bounding rectangles.

Parameters

X:Number — Desired X position of top left corner of the window.
 
Y:Number — Desired Y position of top left corner of the window.

resize()method 
public function resize(Width:Number, Height:Number):void

Resize the window. Subject to pre-specified minimums, maximums, and bounding rectangles.

Parameters

Width:Number — How wide to make the window.
 
Height:Number — How tall to make the window.

updateGUI()method 
protected function updateGUI():void

Figure out if the header or handle are highlighted.

updateSize()method 
protected function updateSize():void

Update the Flash shapes to match the new size, and reposition the header, shadow, and handle accordingly.