Skip to content

Commit

Permalink
Merge pull request flutter#1629 from vlidholt/master
Browse files Browse the repository at this point in the history
Improves sprite physics debug drawing
  • Loading branch information
vlidholt committed Oct 15, 2015
2 parents fb6143d + daf7afa commit 19ff6b5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions skysprites/lib/src/physics_debug.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@ class _PhysicsDebugDraw extends box2d.DebugDraw {
_PhysicsDebugDraw(
box2d.ViewportTransform transform,
this.physicsNode
) : super(transform);
) : super(transform) {
appendFlags(
box2d.DebugDraw.JOINT_BIT |
box2d.DebugDraw.CENTER_OF_MASS_BIT |
box2d.DebugDraw.WIREFRAME_DRAWING_BIT
);
}

PhysicsNode physicsNode;

PaintingCanvas canvas;

void drawSegment(Vector2 p1, Vector2 p2, box2d.Color3i color) {
Paint paint = new Paint()..color = _toColor(color);
Paint paint = new Paint()
..color = _toColor(color)
..strokeWidth = 1.0;
canvas.drawLine(_toPoint(p1), _toPoint(p2), paint);
}

Expand All @@ -33,7 +41,6 @@ class _PhysicsDebugDraw extends box2d.DebugDraw {
}

void drawCircle(Vector2 center, num radius, box2d.Color3i color, [Vector2 axis]) {
print("drawCircle: $center");
Paint paint = new Paint()
..color = _toColor(color)
..setStyle(ui.PaintingStyle.stroke)
Expand Down

0 comments on commit 19ff6b5

Please sign in to comment.