Implement and register this class with a b2World to provide debug drawing of physics entities in your game.
Methods
public AppendFlags( flags: number )
Defined in box2dweb.d.ts:3140
Append flags to the current flags.
Parameters
flags: number
Flags to add.
public ClearFlags( flags: number )
Defined in box2dweb.d.ts:3146
Clear flags from the current flags.
Parameters
flags: number
flags to clear.
public DrawCircle( center: b2Vec2 , radius: number , color: b2Color )
Defined in box2dweb.d.ts:3154
Draw a circle.
Parameters
Circle center point.
radius: number
Circle radius.
Circle draw color.
public DrawPolygon( vertices: b2Vec2 [] , vertexCount: number , color: b2Color )
Defined in box2dweb.d.ts:3162
Draw a closed polygon provided in CCW order.
Parameters
public DrawSegment( p1: b2Vec2 , p2: b2Vec2 , color: b2Color )
Defined in box2dweb.d.ts:3170
Draw a line segment.
Parameters
Line beginpoint.
Line endpoint.
Line color.
public DrawSolidCircle( center: b2Vec2 , radius: number , axis: b2Vec2 , color: b2Color )
Defined in box2dweb.d.ts:3179
Draw a solid circle.
Parameters
Circle center point.
radius: number
Circle radius.
Circle axis.
Circle color.
public DrawSolidPolygon( vertices: b2Vec2 [] , vertexCount: number , color: b2Color )
Defined in box2dweb.d.ts:3187
Draw a solid closed polygon provided in CCW order.
Parameters
public DrawTransform( xf: b2Transform )
Defined in box2dweb.d.ts:3193
Draw a transform. Choose your own length scale.
Parameters
public GetAlpha( ) : number
Defined in box2dweb.d.ts:3199
Get the alpha value used for lines.
Returns
number
Alpha value used for drawing lines.
public GetDrawScale( ) : number
Defined in box2dweb.d.ts:3205
Get the draw scale.
Returns
number
Draw scale ratio.
public GetFillAlpha( ) : number
Defined in box2dweb.d.ts:3211
Get the alpha value used for fills.
Returns
number
Alpha value used for drawing fills.
public GetFlags( ) : number
Defined in box2dweb.d.ts:3217
Get the drawing flags.
Returns
number
Drawing flags.
public GetLineThickness( ) : number
Defined in box2dweb.d.ts:3223
Get the line thickness.
Returns
number
Line thickness.
public GetSprite( ) : CanvasRenderingContext2D
Defined in box2dweb.d.ts:3230
Get the HTML Canvas Element for drawing.
Returns
CanvasRenderingContext2D
The HTML Canvas Element used for debug drawing.
public GetXFormScale( ) : number
Defined in box2dweb.d.ts:3236
Get the scale used for drawing XForms.
Returns
number
Scale for drawing transforms.
public SetAlpha( alpha: number )
Defined in box2dweb.d.ts:3242
Set the alpha value used for lines.
Parameters
public SetDrawScale( drawScale: number )
Defined in box2dweb.d.ts:3248
Set the draw scale.
Parameters
drawScale: number
Draw scale ratio.
public SetFillAlpha( alpha: number )
Defined in box2dweb.d.ts:3254
Set the alpha value used for fills.
Parameters
public SetFlags( flags: number )
Defined in box2dweb.d.ts:3260
Set the drawing flags.
Parameters
flags: number
Sets the drawing flags.
public SetLineThickness( lineThickness: number )
Defined in box2dweb.d.ts:3266
Set the line thickness.
Parameters
lineThickness: number
The new line thickness.
public SetSprite( canvas: CanvasRenderingContext2D )
Defined in box2dweb.d.ts:3273
Set the HTML Canvas Element for drawing.
Parameters
public SetXFormScale( xformScale: number )
Defined in box2dweb.d.ts:3279
Set the scale used for drawing XForms.
Parameters
xformScale: number
The transform scale.