Example #1
0
 public void OnAdded(Console console)
 {
     _borderConsole = new Console(console.Width + 2, console.Height + 2, console.Font);
     _borderConsole.DrawBox(new Rectangle(0, 0, _borderConsole.Width, _borderConsole.Height), _borderCellStyle, null, _borderGlyphs);
     _borderConsole.Position = new Point(-1, -1);
     console.Children.Add(_borderConsole);
 }
Example #2
0
        void DrawOutline(Console console, Color color)
        {
            var rect = new Rectangle(0, 0, console.Width, console.Height);
            var cell = new Cell(Color.White, color, 0);

            console.DrawBox(rect, cell);
        }
Example #3
0
        public static void UpdateSelectionBox(GoRogue.Rectangle box)
        {
            SelectionBox.Resize(box.Width, box.Height, true);
            SelectionBox.Position = box.Position;
            SelectionBox.DrawBox(new Microsoft.Xna.Framework.Rectangle(0, 0, SelectionBox.Width, SelectionBox.Height), new Cell(Color.White, Color.Transparent, 179));

            SelectionBox.ConnectLines();
        }
Example #4
0
 public static void Border(this Console cons, string caption = null)
 {
     cons.DrawBox(
         new Rectangle(0, 0, cons.Width, cons.Height),
         new Cell(cons.DefaultForeground, cons.DefaultBackground),
         connectedLineStyle: CellSurface.ConnectedLineThick);
     if (caption != null)
     {
         var cx = (cons.Width - caption.Length) / 2;
         cons.Print(cx, 0, caption);
     }
 }
Example #5
0
 public void OnAdded(Console console)
 {
     _borderConsole = new Console(console.Width, console.Height, console.Font);
     _borderConsole.DrawBox(new Rectangle(0, 0, _borderConsole.Width, _borderConsole.Height),
                            _borderCellStyle, null, _borderGlyphs);
     _borderConsole.Position    = new Point(-1, -1);
     _borderConsole.UseMouse    = false;
     _borderConsole.UseKeyboard = false;
     console.Children.Add(_borderConsole);
     console.Resize(console.Width - 2, console.Height - 2, true);
     console.Position += new Point(1, 1);
 }
Example #6
0
        public TilesetViewer( ) : base(Program.Width, Program.Height)
        {
            //TilesetConsole.DrawBox( new Rectangle( 0, 0, TilesetConsole.Width, TilesetConsole.Height ), new Cell( Color.Wheat, Color.Black, '%' ) );

            PropertyConsole          = new Console(Width - 64, Height);
            PropertyConsole.Position = new Point(64, 0);
            //TilesetConsole.FillWithRandomGarbage();
            PropertyConsole.DrawBox(new Rectangle(0, 0, PropertyConsole.Width, PropertyConsole.Height), new Cell(Color.Wheat, Color.Black, '#'));
            Children.Add(PropertyConsole);

            LoadTileset("unscii_16_ext.font");
        }
 public void OnAdded(IScreenObject screenObject)
 {
     if (screenObject is Console console)
     {
         _borderConsole      = new Console(console.Width + 2, console.Height + 2);
         _borderConsole.Font = console.Font;
         _borderConsole.DrawBox(new Rectangle(0, 0, _borderConsole.Width, _borderConsole.Height), _borderCellStyle, null, _borderGlyphs);
         _borderConsole.Position = new Point(-1, -1);
         console.Children.Add(_borderConsole);
     }
     else
     {
         throw new Exception("Can only be added to a console");
     }
 }
Example #8
0
        public MenuScreen()
        {
            var ConsoleWidth  = (int)((Global.RenderWidth / Global.FontDefault.Size.X) * 0.30);
            var ConsoleHeight = (int)((Global.RenderHeight / Global.FontDefault.Size.Y) * 1.0);

            Menu = new List <MenuOption>();

            MenuConsole          = new Console(ConsoleWidth - 2, ConsoleHeight - 2);
            MenuConsole.Parent   = this;
            MenuConsole.Position = new Point(MenuConsole.Position.X + 1, MenuConsole.Position.Y + 1);

            BorderConsole          = new Console(ConsoleWidth, ConsoleHeight);
            BorderConsole.Position = new Point(MenuConsole.Position.X - 2, MenuConsole.Position.Y - 2);
            BorderConsole.DrawBox(new Rectangle(0, 0, BorderConsole.Width, BorderConsole.Height), new Cell(Color.White, Color.Navy, 0));
            BorderConsole.Parent    = this;
            BorderConsole.IsVisible = true;
            MenuConsole.Children.Add(BorderConsole);
        }
Example #9
0
        public WorldGen()
        {
            var worldWidth  = 1000;
            var worldHeight = 1000;

            WorldMap = new Console(worldWidth, worldHeight);

            for (int i = 0; i <= WorldMap.Height; i++)
            {
                for (int j = 0; j <= WorldMap.Width; j++)
                {
                    if (i % 8 == 0 && i > 0 && j % 8 == 0 && j > 0)
                    {
                        WorldMap.DrawBox(new Microsoft.Xna.Framework.Rectangle(j, i, 5, 5), new Cell(Color.White, Color.DarkGray, 0));
                    }
                }
            }
            System.Console.WriteLine(WorldMap.GetCells(new Microsoft.Xna.Framework.Rectangle(1, 1, 20, 20)));
        }
Example #10
0
 public void UpdateSize(Console console)
 {
     _borderConsole.Resize(console.Width + 2, console.Height + 2, true);
     _borderConsole.DrawBox(new Rectangle(0, 0, _borderConsole.Width, _borderConsole.Height), _borderCellStyle, null, _borderGlyphs);
 }