Ejemplo n.º 1
0
        public ScrollableConsole(int width, int height, int bufferHeight) : base(width - 1, bufferHeight)
        {
            controlsContainer = new SadConsole.ControlsConsole(1, height);

            textSurface.RenderArea = new Rectangle(0, 0, width, height);

            scrollBar               = SadConsole.Controls.ScrollBar.Create(System.Windows.Controls.Orientation.Vertical, height);
            scrollBar.IsEnabled     = false;
            scrollBar.ValueChanged += ScrollBar_ValueChanged;

            controlsContainer.Add(scrollBar);
            controlsContainer.Position  = new Point(Position.X + width - 1, Position.Y);
            controlsContainer.IsVisible = true;

            virtualCursor.IsVisible = true;
            virtualCursor.Print("Just start typing!");
            IsVisible = false;

            scrollingCounter = 0;
        }
Ejemplo n.º 2
0
        protected override void Initialize()
        {
            // Generally you don't want to hide the mouse from the user
            IsMouseVisible = true;

            // Finish the initialization of SadConsole
            base.Initialize();

            RandomWrapper randomWrapper = new RandomWrapper(2);

            RandomNumberServiceLocator.Provide(randomWrapper);

            // Create the map
            AdventureScreen = new AdventureScreen();
            AdventureScreen.LoadMap(MapGenerator.Generate(200, 200));
            AdventureScreen.SpawnPlayer();

            SadConsole.ControlsConsole startingConsole = new SadConsole.ControlsConsole(SCREEN_WIDTH, SCREEN_HEIGHT);

            var bt1 = new SadConsole.Controls.Button(5);

            startingConsole.Add(bt1);

            SadConsole.Global.CurrentScreen = startingConsole;

            SadConsole.Global.CurrentScreen.Children.Add(AdventureScreen);

            //SimplexNoiseViewer simplexNoiseViewer = new SimplexNoiseViewer(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
            //simplexNoiseViewer.LoadMap(200, 200, 0.03f);
            //SadConsole.Global.CurrentScreen = simplexNoiseViewer;

            //SadConsole.Window window = new SadConsole.Window(10, 10);
            //window.Title = "status";
            //window.Dragable = true;
            //window.Show();
            //SadConsole.Global.CurrentScreen = startingConsole;
            //SadConsole.Global.CurrentScreen.Children.Add(window);
        }