Example #1
0
        public static void DrawRect(Point p, float size, Color color)
        {
            if (Disabled)
            {
                return;
            }

            float margin       = (1.0f - size) / 2;
            float x            = p.X + margin;
            float y            = p.Y + margin;
            var   screenOffset = new Vec2Float(0, 0);
            var   command      = new DebugCommand.Add
            {
                Data = new DebugData.Primitives(new[]
                {
                    new ColoredVertex(new Vec2Float(x, y), screenOffset, color),
                    new ColoredVertex(new Vec2Float(x + size, y), screenOffset, color),
                    new ColoredVertex(new Vec2Float(x + size, y + size), screenOffset, color),

                    new ColoredVertex(new Vec2Float(x, y), screenOffset, color),
                    new ColoredVertex(new Vec2Float(x, y + size), screenOffset, color),
                    new ColoredVertex(new Vec2Float(x + size, y + size), screenOffset, color),
                }, PrimitiveType.Triangles)
            };

            Commands.Add(command);
        }
Example #2
0
        public static void DrawLine(Vec2Int p1, Vec2Int p2, Color color, DebugInterface debugInterface)
        {
            var vertex1 = new ColoredVertex(new Vec2Float(p1.X + 0.5f, p1.Y + 0.5f), new Vec2Float(0, 0), color);
            var vertex2 = new ColoredVertex(new Vec2Float(p2.X + 0.5f, p2.Y + 0.5f), new Vec2Float(0, 0), color);

            var debugData    = new DebugData.Primitives(new[] { vertex1, vertex2 }, PrimitiveType.Lines);
            var debugCommand = new DebugCommand.Add(debugData);

            debugInterface.Send(debugCommand);
        }
Example #3
0
        public static void DrawRegion(int x, int y, Color color, DebugInterface debugInterface)
        {
            var vertex1 = new ColoredVertex(new Vec2Float(x + 0.25f, y + 0.25f), new Vec2Float(0, 0), color);
            var vertex2 = new ColoredVertex(new Vec2Float(x + 0.75f, y + 0.25f), new Vec2Float(0, 0), color);
            var vertex3 = new ColoredVertex(new Vec2Float(x + 0.75f, y + 0.75f), new Vec2Float(0, 0), color);
            var vertex4 = new ColoredVertex(new Vec2Float(x + 0.25f, y + 0.75f), new Vec2Float(0, 0), color);

            var debugData    = new DebugData.Primitives(new[] { vertex1, vertex2, vertex3, vertex4 }, PrimitiveType.Lines);
            var debugCommand = new DebugCommand.Add(debugData);

            debugInterface.Send(debugCommand);
        }