Exemplo n.º 1
0
 public override void DebugRender(Batcher batcher)
 {
     if (_cameraStyle == CameraStyle.LockOn)
     {
         batcher.DrawHollowRect(_worldSpaceDeadzone.X - 5, _worldSpaceDeadzone.Y - 5, 10, 10, Color.DarkRed);
     }
     else
     {
         batcher.DrawHollowRect(_worldSpaceDeadzone, Color.DarkRed);
     }
 }
Exemplo n.º 2
0
        public override void DebugRender(Batcher batcher)
        {
            var poly = Shape as Polygon;

            batcher.DrawHollowRect(Bounds, Debug.Colors.ColliderBounds, Debug.Size.LineSizeMultiplier);
            batcher.DrawPolygon(Shape.position, poly.Points, Debug.Colors.ColliderEdge, true,
                                Debug.Size.LineSizeMultiplier);
            batcher.DrawPixel(Entity.Transform.Position, Debug.Colors.ColliderPosition,
                              4 * Debug.Size.LineSizeMultiplier);
            batcher.DrawPixel(Shape.position, Debug.Colors.ColliderCenter, 2 * Debug.Size.LineSizeMultiplier);

            // Normal debug code
            //for( var i = 0; i < poly.points.Length; i++ )
            //{
            //	Vector2 p2;
            //	var p1 = poly.points[i];
            //	if( i + 1 >= poly.points.Length )
            //		p2 = poly.points[0];
            //	else
            //		p2 = poly.points[i + 1];
            //	var perp = Vector2Ext.perpendicular( ref p1, ref p2 );
            //	Vector2Ext.normalize( ref perp );
            //	var mp = Vector2.Lerp( p1, p2, 0.5f ) + poly.position;
            //	batcher.drawLine( mp, mp + perp * 10, Color.White );
            //}
        }
Exemplo n.º 3
0
        public override void DebugRender(Batcher batcher)
        {
            for (var i = 0; i < _vertices.Length; i++)
            {
                var v = _vertices[i];
                batcher.DrawPixel(v.Position.X, v.Position.Y, Color.GhostWhite, 4);
            }

            batcher.DrawHollowRect(_bounds, Debug.Colors.ColliderBounds);
        }
Exemplo n.º 4
0
        /// <summary>
        /// returns true if we are done with this debug draw item
        /// </summary>
        public bool Draw(Batcher batcher)
        {
            switch (drawType)
            {
            case DebugDrawType.Line:
                batcher.DrawLine(Start, End, Color);
                break;

            case DebugDrawType.HollowRectangle:
                batcher.DrawHollowRect(Rectangle, Color);
                break;

            case DebugDrawType.Pixel:
                batcher.DrawPixel(X, Y, Color, Size);
                break;

            case DebugDrawType.BitmapFontText:
                batcher.DrawString(BitmapFont, Text, Position, Color, 0f, Vector2.Zero, Scale,
                                   SpriteEffects.None, 0f);
                break;

            case DebugDrawType.SpriteFontText:
                batcher.DrawString(SpriteFont, Text, Position, Color, 0f, Vector2.Zero, new Vector2(Scale),
                                   SpriteEffects.None, 0f);
                break;

            case DebugDrawType.ConsoleText:
                batcher.DrawString(BitmapFont, Text, Position, Color, 0f, Vector2.Zero, Scale,
                                   SpriteEffects.None, 0f);
                break;

            case DebugDrawType.Circle:
                batcher.DrawCircle(X, Y, Radius, Color);
                break;
            }

            Duration -= Time.DeltaTime;

            return(Duration < 0f);
        }