private static void Draw()
        {
            foreach (Player p in LocalClient.ServerPlayers)
            {
                p.Draw();

                int x = (int)MathHelper.Clamp(p.Position.X - (p.Name.Length / 2), 0, (Console.BufferWidth - 1) - p.Name.Length);
                int y = (int)MathHelper.Clamp(p.Position.Y - 1, 0, (Console.BufferWidth - 1));

                DrawManager.DrawString(p.Name, new Vector2(x, y), p.Drawable.Color);
            }

            foreach (Drawable d in World.CharTiles)
            {
                if (d.DrawChar != ' ')
                {
                    Console.SetCursorPosition(d.Position.X, d.Position.Y);
                    Console.ForegroundColor = d.Color;
                    Console.Write(d.DrawChar);
                }
            }

            Chat.Draw();

            DrawManager.Paint();
        }
Esempio n. 2
0
        private static void DrawWriteArea()
        {
            /*Console.SetCursorPosition(X, Height);
             * Console.Write("> " + Text);*/

            for (int x = X; x < Width; x++)
            {
                DrawManager.DrawString(" ", new Vector2(x, Height), ConsoleColor.DarkGray);
            }

            DrawManager.DrawString("> " + Text, new Vector2(X, Height), ConsoleColor.DarkGray);
        }
Esempio n. 3
0
        private static void ClearDrawArea()
        {
            for (int y = Y; y < Y + Height; y++)
            {
                for (int x = X; x < X + Width; x++)
                {
                    if (y == Y && x == X + (Title.Length / 2))
                    {
                        DrawManager.DrawString(Title, new Vector2(x, y), ConsoleColor.DarkGray);
                        x += Title.Length;
                    }

                    if (x == X || x == Width - 1)
                    {
                        DrawManager.DrawString(OutlineCharY.ToString(), new Vector2(x, y), ConsoleColor.DarkGray);
                    }
                    else if (y == Y || y == Height - 1)
                    {
                        DrawManager.DrawString(OutlineCharX.ToString(), new Vector2(x, y), ConsoleColor.DarkGray);
                    }
                }
            }
        }