Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
79ec7454
Commit
79ec7454
authored
Oct 15, 2015
by
Viktor Lidholt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improves sprite physics debug drawing
parent
6e91cfa4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
physics_debug.dart
packages/flutter_sprites/lib/src/physics_debug.dart
+10
-3
No files found.
packages/flutter_sprites/lib/src/physics_debug.dart
View file @
79ec7454
...
...
@@ -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
);
}
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment