Пример #1
0
        public override void Draw(SpriteBatch sb = null)
        {
            base.Draw(sb);

            if (Debug)
            {
                //Draw a bounding rect around it's drawrect
                var r = new DrawingTools.Rectangle(DrawRect.X, DrawRect.Y, DrawRect.Width, DrawRect.Height);
                r.Color = Color.Red;
                r.Thickness = 1;
                r.Draw(sb);

                var origin = new DrawingTools.Point((int)(GetDependency<Body>(DEPENDENCY_BODY).Origin.X + DrawRect.X), (int) (GetDependency<Body>(DEPENDENCY_BODY).Origin.Y + DrawRect.Y));
                origin.Color = Color.Orange;
                origin.Draw(sb);
            }
        }
Пример #2
0
        public void DrawDebug(SpriteBatch sb)
        {
            if (_points.Count < 2 && _points.Count > 0)
            {
                //Only draw the one Point
                var singlepoint = new DrawingTools.Point((int)First.X, (int)First.Y);
                singlepoint.Thickness = 3;
                singlepoint.Color = DebugPointColor;
                singlepoint.Layer = 10;
            }
            else if (_points.Count < 0) return;

            //get our first line, then automate the rest.
            var point1 = new DrawingTools.Point((int) First.X, (int) First.Y);
            point1.Thickness = 3;
            point1.Color = DebugPointColor;
            point1.Layer = 1;
            point1.Draw(sb);

            var line = new DrawingTools.Line(new Vector2(First.X, First.Y), new Vector2(_points[1].X, _points[1].Y));
            line.Color = DebugLineColor;
            line.Layer = 1f;
            line.Draw(sb);

            var point2 = new DrawingTools.Point((int) _points[1].X, (int) _points[1].Y);
            point2.Thickness = 3;
            point2.Color = DebugPointColor;
            point2.Layer = 1;
            point2.Draw(sb);

            //Now we start getting the rest of the path
            for (int i = 2; i < Count; i++)
            {
                point1 = point2;

                point2 = new DrawingTools.Point((int) _points[i].X, (int) _points[i].Y);
                point2.Thickness = 3;
                point2.Color = DebugPointColor;
                point2.Layer = 1;
                point2.Draw(sb);

                line = new DrawingTools.Line(new Vector2(point1.X, point1.Y), new Vector2(point2.X, point2.Y), DebugLineColor);
                line.Layer = 1;
                line.Draw(sb);
            }
        }