コード例 #1
0
        private void MakeBasicSurface()
        {
            basicSurface.Print(0, 0, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890".Repeat(9));
            basicSurface.SetGlyph(0, 0, 7);
            basicSurface.SetGlyph(1, 0, 8);
            basicSurface.SetGlyph(2, 0, 9);
            basicSurface.SetGlyph(3, 0, 10);
            ColorGradient gradient = new ColorGradient(StarterProject.Theme.Blue, StarterProject.Theme.Yellow);

            for (int i = 0; i < 510; i += 10)
            {
                var point = basicSurface.GetPointFromIndex(i);
                basicSurface.Print(point.X, point.Y, gradient.ToColoredString(basicSurface.GetString(i, 10)));
            }

            // Mirror 1
            int startSet1 = new Point(0, 3).ToIndex(34);
            int startSet2 = new Point(0, 6).ToIndex(34);
            int startSet3 = new Point(0, 9).ToIndex(34);

            for (int i = 0; i < 34 * 3; i++)
            {
                basicSurface.Cells[startSet1 + i].Mirror     = Microsoft.Xna.Framework.Graphics.SpriteEffects.FlipVertically;
                basicSurface.Cells[startSet1 + i].Background = StarterProject.Theme.PurpleDark;

                basicSurface.Cells[startSet2 + i].Mirror     = Microsoft.Xna.Framework.Graphics.SpriteEffects.FlipHorizontally;
                basicSurface.Cells[startSet2 + i].Background = StarterProject.Theme.OrangeDark;

                basicSurface.Cells[startSet3 + i].Mirror     = Microsoft.Xna.Framework.Graphics.SpriteEffects.FlipHorizontally | Microsoft.Xna.Framework.Graphics.SpriteEffects.FlipVertically;
                basicSurface.Cells[startSet3 + i].Background = StarterProject.Theme.GreenDark;
            }
        }
コード例 #2
0
 public SpaceMapConsole(int width, int height) : base(width, height)
 {
     Width         = width;
     Height        = height;
     trackedRegion = new Rectangle(0, 0, width, height);
     tooltip       = new SadConsole.Console(10, 1);
     mouseCursor   = new SadConsole.Console(1, 1);
     mouseCursor.SetGlyph(0, 0, 178, new Color(255, 255, 255, 255));
     mouseCursor.UseMouse = false;
     tooltip.UseMouse     = false;
     tooltip.IsVisible    = false;
     Children.Add(tooltip);
     Children.Add(mouseCursor);
 }
コード例 #3
0
        public SelectedShipConsole(int width, int height) : base(width, height)
        {
            Width       = width;
            Height      = height;
            mouseCursor = new SadConsole.Console(1, 1);
            mouseCursor.SetGlyph(0, 0, 178, new Color(255, 255, 255, 255));
            mouseCursor.UseMouse = false;
            Children.Add(mouseCursor);

            // Set up controls:
            Button btnShip = new Button(14, 1);

            btnShip.Name      = "HeaderButton";
            btnShip.Position  = new Point(0, 0);
            btnShip.IsEnabled = true;
            btnShip.IsVisible = true;
            btnShip.Text      = "Ship Console";
            this.Add(btnShip);
            btnShip.Click += BtnShip_Click;
        }