PackageBox2D.Dynamics
Classpublic class b2DebugDraw
Sourceb2DebugDraw.as

Implement and register this class with a b2World to provide debug drawing of physics entities in your game.



Public Properties
 PropertyDefined by
  e_aabbBit : uint = 0x0008
[static] Draw axis aligned bounding boxes
b2DebugDraw
  e_centerOfMassBit : uint = 0x0040
[static] Draw center of mass frame
b2DebugDraw
  e_coreShapeBit : uint = 0x0004
[static] Draw core (toi) shapes
b2DebugDraw
  e_jointBit : uint = 0x0002
[static] Draw joint connections
b2DebugDraw
  e_obbBit : uint = 0x0010
[static] Draw oriented bounding boxes
b2DebugDraw
  e_pairBit : uint = 0x0020
[static] Draw broad-phase pairs
b2DebugDraw
  e_shapeBit : uint = 0x0001
[static] Draw shapes
b2DebugDraw
Public Methods
 MethodDefined by
  
b2DebugDraw
  
AppendFlags(flags:uint):void
Append flags to the current flags.
b2DebugDraw
  
ClearFlags(flags:uint):void
Clear flags from the current flags.
b2DebugDraw
  
DrawCircle(center:b2Vec2, radius:Number, color:b2Color):void
Draw a circle.
b2DebugDraw
  
DrawPolygon(vertices:Array, vertexCount:int, color:b2Color):void
Draw a closed polygon provided in CCW order.
b2DebugDraw
  
DrawSegment(p1:b2Vec2, p2:b2Vec2, color:b2Color):void
Draw a line segment.
b2DebugDraw
  
DrawSolidCircle(center:b2Vec2, radius:Number, axis:b2Vec2, color:b2Color):void
Draw a solid circle.
b2DebugDraw
  
DrawSolidPolygon(vertices:Array, vertexCount:int, color:b2Color):void
Draw a solid closed polygon provided in CCW order.
b2DebugDraw
  
DrawXForm(xf:b2XForm):void
Draw a transform.
b2DebugDraw
  
GetAlpha():Number
Get the alpha value used for lines
b2DebugDraw
  
GetDrawScale():Number
Get the draw
b2DebugDraw
  
GetFillAlpha():Number
Get the alpha value used for fills
b2DebugDraw
  
GetFlags():uint
Get the drawing flags.
b2DebugDraw
  
Get the line thickness
b2DebugDraw
  
GetSprite():Sprite
Get the sprite
b2DebugDraw
  
GetXFormScale():Number
Get the scale used for drawing XForms
b2DebugDraw
  
SetAlpha(alpha:Number):void
Set the alpha value used for lines
b2DebugDraw
  
SetDrawScale(drawScale:Number):void
Set the draw scale
b2DebugDraw
  
SetFillAlpha(alpha:Number):void
Set the alpha value used for fills
b2DebugDraw
  
SetFlags(flags:uint):void
Set the drawing flags.
b2DebugDraw
  
SetLineThickness(lineThickness:Number):void
Set the line thickness
b2DebugDraw
  
SetSprite(sprite:Sprite):void
Set the sprite
b2DebugDraw
  
SetXFormScale(xformScale:Number):void
Set the scale used for drawing XForms
b2DebugDraw
Property detail
e_aabbBitproperty
public static var e_aabbBit:uint = 0x0008

Draw axis aligned bounding boxes

e_centerOfMassBitproperty 
public static var e_centerOfMassBit:uint = 0x0040

Draw center of mass frame

e_coreShapeBitproperty 
public static var e_coreShapeBit:uint = 0x0004

Draw core (toi) shapes

e_jointBitproperty 
public static var e_jointBit:uint = 0x0002

Draw joint connections

e_obbBitproperty 
public static var e_obbBit:uint = 0x0010

Draw oriented bounding boxes

e_pairBitproperty 
public static var e_pairBit:uint = 0x0020

Draw broad-phase pairs

e_shapeBitproperty 
public static var e_shapeBit:uint = 0x0001

Draw shapes

Constructor detail
b2DebugDraw()constructor
public function b2DebugDraw()
Method detail
AppendFlags()method
public function AppendFlags(flags:uint):void

Append flags to the current flags.

Parameters
flags:uint
ClearFlags()method 
public function ClearFlags(flags:uint):void

Clear flags from the current flags.

Parameters
flags:uint
DrawCircle()method 
public function DrawCircle(center:b2Vec2, radius:Number, color:b2Color):void

Draw a circle.

Parameters
center:b2Vec2
 
radius:Number
 
color:b2Color
DrawPolygon()method 
public function DrawPolygon(vertices:Array, vertexCount:int, color:b2Color):void

Draw a closed polygon provided in CCW order.

Parameters
vertices:Array
 
vertexCount:int
 
color:b2Color
DrawSegment()method 
public function DrawSegment(p1:b2Vec2, p2:b2Vec2, color:b2Color):void

Draw a line segment.

Parameters
p1:b2Vec2
 
p2:b2Vec2
 
color:b2Color
DrawSolidCircle()method 
public function DrawSolidCircle(center:b2Vec2, radius:Number, axis:b2Vec2, color:b2Color):void

Draw a solid circle.

Parameters
center:b2Vec2
 
radius:Number
 
axis:b2Vec2
 
color:b2Color
DrawSolidPolygon()method 
public function DrawSolidPolygon(vertices:Array, vertexCount:int, color:b2Color):void

Draw a solid closed polygon provided in CCW order.

Parameters
vertices:Array
 
vertexCount:int
 
color:b2Color
DrawXForm()method 
public function DrawXForm(xf:b2XForm):void

Draw a transform. Choose your own length scale.

Parameters
xf:b2XForm — a transform.
GetAlpha()method 
public function GetAlpha():Number

Get the alpha value used for lines

Returns
Number
GetDrawScale()method 
public function GetDrawScale():Number

Get the draw

Returns
Number
GetFillAlpha()method 
public function GetFillAlpha():Number

Get the alpha value used for fills

Returns
Number
GetFlags()method 
public function GetFlags():uint

Get the drawing flags.

Returns
uint
GetLineThickness()method 
public function GetLineThickness():Number

Get the line thickness

Returns
Number
GetSprite()method 
public function GetSprite():Sprite

Get the sprite

Returns
Sprite
GetXFormScale()method 
public function GetXFormScale():Number

Get the scale used for drawing XForms

Returns
Number
SetAlpha()method 
public function SetAlpha(alpha:Number):void

Set the alpha value used for lines

Parameters
alpha:Number
SetDrawScale()method 
public function SetDrawScale(drawScale:Number):void

Set the draw scale

Parameters
drawScale:Number
SetFillAlpha()method 
public function SetFillAlpha(alpha:Number):void

Set the alpha value used for fills

Parameters
alpha:Number
SetFlags()method 
public function SetFlags(flags:uint):void

Set the drawing flags.

Parameters
flags:uint
SetLineThickness()method 
public function SetLineThickness(lineThickness:Number):void

Set the line thickness

Parameters
lineThickness:Number
SetSprite()method 
public function SetSprite(sprite:Sprite):void

Set the sprite

Parameters
sprite:Sprite
SetXFormScale()method 
public function SetXFormScale(xformScale:Number):void

Set the scale used for drawing XForms

Parameters
xformScale:Number