Package | com.boristhebrave.Box2DWith |
Class | public class b2Graphics |
Property | Defined by | ||
---|---|---|---|
awakeColor : uint = 0xE6E6E6 The color to use for awake dynamic bodies.
| b2Graphics | ||
fillAlpha : Number = 0.5 The alpha to use for filling in bodies.
| b2Graphics | ||
graphics : Graphics The wrapped Graphics to draw to.
| b2Graphics | ||
jointColor : uint = 0x80CDCD The color to use for drawing joints.
| b2Graphics | ||
lineThickness : Number = 1 The line thickness to use for drawing, in pixels.
| b2Graphics | ||
physScale : Number The scale between pixels and Box2D units, in pixels/unit.
| b2Graphics | ||
sleepColor : uint = 0x8080E6 The color to use for sleeping dynamic bodies.
| b2Graphics | ||
staticColor : uint = 0x80E680 The color to use for static bodies.
| b2Graphics | ||
xformScale : Number = 3 The size to draw xforms at, in units.
| b2Graphics |
Method | Defined by | ||
---|---|---|---|
b2Graphics(graphics:Graphics, physScale:Number)
Creates a wrapper for Graphics, with it's own set of drawing properties.
| b2Graphics | ||
drawBody(body:b2Body):void
Draws a body, including styling.
| b2Graphics | ||
drawBodyLocal(body:b2Body):void
Draws a body in local co-ordinates, including styling.
| b2Graphics | ||
drawBodyOutline(body:b2Body):void
Draws the given body, without setting any style properties.
| b2Graphics | ||
drawBodyOutlineLocal(body:b2Body):void
Draws the given body in local cordinates, without setting any style properties.
| b2Graphics | ||
drawJoint(joint:b2Joint):void
Draws a joint, including styling.
| b2Graphics | ||
drawJointOutline(joint:b2Joint):void
Draws the given joint, without setting any style properties.
| b2Graphics | ||
drawSegment(p1:b2Vec2, p2:b2Vec2):void
Draws an unstyled line.
| b2Graphics | ||
drawShapeOutline(shape:b2Shape):void
Draws the given shape in world co-ordinates, without setting any style properties.
| b2Graphics | ||
drawShapeOutlineLocal(shape:b2Shape):void
Draws the given shape in local co-ordinates, without setting any style properties.
| b2Graphics | ||
drawWorld(world:b2World):void
Draws a world, including styling.
| b2Graphics |
awakeColor | property |
public var awakeColor:uint = 0xE6E6E6
The color to use for awake dynamic bodies.
fillAlpha | property |
public var fillAlpha:Number = 0.5
The alpha to use for filling in bodies.
graphics | property |
public var graphics:Graphics
The wrapped Graphics to draw to.
jointColor | property |
public var jointColor:uint = 0x80CDCD
The color to use for drawing joints.
lineThickness | property |
public var lineThickness:Number = 1
The line thickness to use for drawing, in pixels.
physScale | property |
public var physScale:Number
The scale between pixels and Box2D units, in pixels/unit.
sleepColor | property |
public var sleepColor:uint = 0x8080E6
The color to use for sleeping dynamic bodies.
staticColor | property |
public var staticColor:uint = 0x80E680
The color to use for static bodies.
xformScale | property |
public var xformScale:Number = 3
The size to draw xforms at, in units.
b2Graphics | () | constructor |
public function b2Graphics(graphics:Graphics, physScale:Number)
Creates a wrapper for Graphics, with it's own set of drawing properties.
Parametersgraphics:Graphics — The Graphics object to wrap.
|
|
physScale:Number — The scaling to use, in pixels/unit.
|
drawBody | () | method |
public function drawBody(body:b2Body):void
Draws a body, including styling.
Parametersbody:b2Body |
drawBodyLocal | () | method |
public function drawBodyLocal(body:b2Body):void
Draws a body in local co-ordinates, including styling.
Parametersbody:b2Body |
drawBodyOutline | () | method |
public function drawBodyOutline(body:b2Body):void
Draws the given body, without setting any style properties. Use this instead of drawBody if you want a more customized looking shape.
Parametersbody:b2Body |
drawBodyOutlineLocal | () | method |
public function drawBodyOutlineLocal(body:b2Body):void
Draws the given body in local cordinates, without setting any style properties. Use this instead of drawBodyLocal if you want a more customized looking shape.
Parametersbody:b2Body |
drawJoint | () | method |
public function drawJoint(joint:b2Joint):void
Draws a joint, including styling.
Parametersjoint:b2Joint |
drawJointOutline | () | method |
public function drawJointOutline(joint:b2Joint):void
Draws the given joint, without setting any style properties. Use this instead of drawJoint if you want a more customized looking shape.
Parametersjoint:b2Joint |
drawSegment | () | method |
public function drawSegment(p1:b2Vec2, p2:b2Vec2):void
Draws an unstyled line.
Parametersp1:b2Vec2 |
|
p2:b2Vec2 |
drawShapeOutline | () | method |
public function drawShapeOutline(shape:b2Shape):void
Draws the given shape in world co-ordinates, without setting any style properties. Use this instead of drawShape if you want a more customized looking shape.
Parametersshape:b2Shape |
drawShapeOutlineLocal | () | method |
public function drawShapeOutlineLocal(shape:b2Shape):void
Draws the given shape in local co-ordinates, without setting any style properties. Use this instead of drawShapeLocal if you want a more customized looking shape.
Parametersshape:b2Shape |
drawWorld | () | method |
public function drawWorld(world:b2World):void
Draws a world, including styling. Note that it is more efficient to draw bodies into separate DisplayObjects once, and then move them around, than to call drawWorld once per frame.
Parametersworld:b2World |